#include <iostream>
using namespace std;
int main() {
char str[30] = { 0 };
cin.getline(str, sizeof(str));
int m;
cin >> m;
// write your code here......
char *c=str;
while(*(c+m-1)!='\0'){
cout<<*(c+m-1);
m++;
}
return 0;
}