int main() { int m,n; scanf("%d%d",&m,&n ); int list[999]; for (int i = 0; i < m; ++i) { scanf("%d",&list[i]); } for (int j = 0; j < n; ++j) { int temp = list[0]; for (int i = 1; i <m ; ++i) { list[i-1]=list[i]; } list[m-1]=temp; }
for (int i = 0; i < m-1; ++i) { printf("%d ",list[i]); } printf("%d",list[m-1]); return 0; }