#include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ll;
ll n,d = 0,k;
string s;
int main()
{
    freopen("BAI3_18.inp","r",stdin);
    freopen("BAI3_18.out","w",stdout);
    cin>>n>>s;
    n=n%(s.size());
    n=(ll)s.size()-n;
    for (ll i=0;i<n;i++)
    {
        s.push_back(s[i]);
    }
    for (ll i=n;i<s.size();i++)
    {
        putchar(s[i]);
    }
}
