#include <iostream>
using namespace std;
void rotatearray(int a[],int n){
int b = a[0];
for(int i = 0; i<n-1;i++){
int temp = a[i];
a[i] = a[i+1];
a[i+1] = a[i];
}
a[n-1] = b;
}
int main(){
int n;
cin >> n;
int a[n];
cout << "enter the array elements:";
for (int i =0; i<n;i++){
cin >> a[i];
}
int m;
cin >> m ;
for (int i =0;i<m; i++){
rotatearray(a,n);
}
for (int i = 0; i<n; i++){
cout << a[i];
}
}