#include<bits/stdc++.h>
using namespace std;
int main () {
string str;
int n;
while(cin>>str>>n) {
cout<<str.substr(0,n)<<endl; //截取字符串[0,n)位,长度为n的字符串
}
return 0;
} 
#include<bits/stdc++.h>
using namespace std;
int main () {
string str;
int n;
while(cin>>str>>n) {
cout<<str.substr(0,n)<<endl; //截取字符串[0,n)位,长度为n的字符串
}
return 0;
}