#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* s=str,*p;
    int count=0;
    for(;*s!='\0';s++){
        count++;
        if(count==m){
            p=s;
            break;
        }
    }
    while(*p!='\0'){
        cout<<*(p++);
    }
    return 0;
}