#include<bits/stdc++.h>
using namespace std;
int main ()
{
    string str;
    int n;
    while(cin>>str>>n)
        cout<<str.substr(0,n)<<endl;
}