#include<iostream>
using namespace std;
int main()
{
    string s;
    int d;
    while(cin>>s>>d)
    {
        string res;
        int i=0;
        while(d--)
        {
            if(s[i]=='\0')
            {
                break;
            }
            else
            {
                res.push_back(s[i]);
                i++;
            }
        }
        cout<<res<<endl;
    }
    return 0;
}