#include <fstream>
using namespace std;
ifstream f1("bai3_18.inp");
ofstream f2("bai3_18.out");
long n;
string s;
int main()
{
    f1 >> n;
    f1 >> s;
    for (long i = n%s.length() + 1; i < s.length(); i++) f2 << s[i];
    for (long i = 0; i < n%s.length() + 1; i++) f2 << s[i];
    return 0;
}
