#include <bits/stdc++.h>
#include <iostream>
#include <string>

using namespace std;

int main(){
    string str = "";
    getline(cin, str);
    int num = 0;
    cin >> num;
    
    string res = "";
    for(char c : str){  
        if(num == 0) break;
        res += c;
        num--;
    }
    
    cout << res << endl;
    
    return 0;
}