#include<stdio.h>
int main(){
int n,m,i,j;
int p;
scanf("%d\t",&n);
scanf("%d\n",&m);
if(m>n)
m=m-n;
int a[n+m];
for(i=0;i<n;i++){
scanf("%d",&a[i]);
}
i=0;
while(i<=n){
a[n+m-i]=a[n-i];
i++;
}
i=0;
while(i<m){
a[i]=a[n+i];
i++;
}
for(j=0;j<n;j++){
if(j==n-1)
printf("%d",a[j]);
else printf("%d ",a[j]);
}
return 0;
}
11-03
06-28