#include <stdio.h>
#include <string.h>
int length(char *a) {
char *start;
start = a;
while (*a != '\0') {
a++;
}
int len = a - start;
return len;
}
void copy(char from[], char to[]) {
int i = 0;
while (from[i] != '\0') {
to[i] = from[i];
i++;
}
to[i] = '\0';
}
void move(int a, char s[]) {
int i = 0;
int len = length(s);
char s_move[len + 1];
while (s[i] != '\0') {
if (i < a) {
s_move[i] = s[len - a + i];
} else {
s_move[i] = s[i - a];
}
i++;
}
s_move[i] = '\0';
copy(s_move, s);
printf("%s", s);
}
int main() {
int x;
char a[1001];
scanf("%d\n", &x);
scanf("%[^\n]", a);
move(x, a);
return 0;
}