#include<bits/stdc++.h>
using namespace std;
int main()
{
    freopen("bai3_18.inp","r",stdin);
    freopen("bai_18.out","w",stdout);
    int64_t k;
    cin>>k;
    string s="";
    cin>>s;
    for(int64_t i=s.length()-k;i<s.length();i++)
    {
        cout<<s[i];
    }
    for(int64_t i=0;i<s.length()-k;i++)
    {
        cout<<s[i];
    }
}
