#include <iostream>
using namespace std;
int main()
{
int n , k , arr[n];
cin >> n >> k;
for ( int i = 0 ; i < n ; i ++ )
{
cin >> arr[i];
}
for ( int b = 0 ; b < k ; b ++ )
{
for ( int i = n ; i > 0 ; i -- )
{
arr[i] = arr[i - 1];
}
}
for ( int i = 0 ; i < n ; i ++ )
{
cout << arr[i];
}
return 0;
}