#include <bits/stdc++.h>
using namespace std;
typedef int ll;
ll n,d = 0;
bool check(ll a,ll b,ll c)
{
    return (a+b)>c&&(b+c)>a&&(c+a)>b;
}
struct T
{
    ll a,b,c;
}q[5000];
ll a[5000];
void r(ll &x)
{
    x=0;
    char a;
    a=getchar();
    for (;a>='0'&&a<='9';a=getchar())
    {
        x = x*10 + a - '0';
    }
}
void w(ll x)
{
    if (x>9) w(x/10);
    putchar(x%10+48);
}
string s;
int main()
{
    freopen("BAI3_18.inp","r",stdin);
    freopen("BAI3_18.out","w",stdout);
    cin>>n>>s;
    n=n%(s.size());
    ll k=n;
    n=s.size()-n;
    for (int i=0;i<n;i++)
    {
        s.push_back(s[i]);
    }
    for (int i=n;i<s.size();i++)
    {
        cout<<s[i];
    }
}
