#include <iostream>
#include <stdio.h>
#include <string>
using namespace std;
int main() {
char a[33] ;
int n;
scanf("%s %d", a, &n);
char *p = a;
p+=n-1;
while(*p!='\0')
{
printf("%c",*p) ;
p++;
}
return 0;
}