#include <stdio.h>
void rotate_left(int arr[], int n, int k) {
k %= n; // Handle cases where k >= n
for (int i = 0; i < k; i++) {
int temp = arr[0]; // Store the first element
for (int j = 0; j < n - 1; j++) {
arr[j] = arr[j + 1]; // Shift elements to the left
}
arr[n - 1] = temp; // Place the first element at the end
// [2,3,4,5,1]
// [3,4,5,1,2]
}
}
int main() {
int n, k;
scanf("%d %d", &n, &k);
int arr[100];
// Read array elements
for (int i = 0; i < n; i++) {
scanf("%d", &arr[i]);
}
// Rotate the array
rotate_left(arr, n, k);
// Print the rotated array
for (int i = 0; i < n; i++) {
printf("%d", arr[i]);
if(i < n-1){
printf(" ");
}
}
return 0;
}