#include<stdio.h>
#include<iostream>
#include<algorithm>
using namespace std;
void leftRotate(int *arr, int n, int k);
int main() {
int n;
int k;
int arr[101];
cin >> n >> k;
for (int i = 0; i < n; i++) {
cin >> arr[i];
}
leftRotate(arr, n, k);
for (int i = 0; i < n; i++) {
if(i < n-1) cout<<arr[i]<<" ";
else cout<<arr[i];
}
return 0;
}
void leftRotate(int *arr, int n, int k) {
int temp = 0;
int i, j;
for (j = 1; j <=k; j++ ) {//外层循环移动次数
temp = arr[0];
for (i = 0; i < n - 1; i++) {//移动一次
arr[i] = arr[i + 1];
}
arr[i] = temp;
}
}