#include<iostream>
#include<string>
using namespace std;
int main(){
int k;
string s;
while(cin>>k){
cin>>s;
int len=s.size();
int p=len-1;
char temp;
while(k--){
temp=s[p];
for(int i=p;i>0;i--){
s[i]=s[i-1];
}
s[0]=temp;
}
cout<<s<<endl;
}
return 0;
}