#include <algorithm>

using namespace std;

int main() {
    string str;
    while(getline(cin,str)){
        int k;
        cin>>k;
        string temp;
        temp = str.substr(0,k);
        cout<<temp<<endl;
    }
}