#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 = s.length(); i < 2*s.length(); i++) s[i] = s[i-s.length()];
    for (long i = n%s.length()+1; i <= (n%s.length())+s.length(); i++) f2 << s[i];
    return 0;
}
