#include<iostream>
#include<cstdio>
#include<vector>
#include<bits/stdc++.h>
using namespace std;
int Length(string s)
{
int len=0;
for(int i=0;s[i]!='\0';i++)
{
len++;
}
return len;
}
string InsertAtPos(string s,int pos,string sub)
{
string res=" ";
int lens=Length(s);
int lensub=Length(sub);
for(int i=0;i<pos;i++)
{
res=res+s[i];
}
res=res+sub;
for(int i=pos;i<lens;i++)
{
res=res+s[i];
}
return res;
}
int main()
{
string s,sub;
int pos;
cin>>s>>sub>>pos;
string res=InsertAtPos(s,pos,sub);
cout<<res<<endl;
return 0;
}
I2luY2x1ZGU8aW9zdHJlYW0+CiNpbmNsdWRlPGNzdGRpbz4KI2luY2x1ZGU8dmVjdG9yPgojaW5jbHVkZTxiaXRzL3N0ZGMrKy5oPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwppbnQgTGVuZ3RoKHN0cmluZyBzKQp7CmludCBsZW49MDsKZm9yKGludCBpPTA7c1tpXSE9J1wwJztpKyspCnsKbGVuKys7Cn0KcmV0dXJuIGxlbjsKfQpzdHJpbmcgSW5zZXJ0QXRQb3Moc3RyaW5nIHMsaW50IHBvcyxzdHJpbmcgc3ViKQp7CnN0cmluZyByZXM9IiAiOwppbnQgbGVucz1MZW5ndGgocyk7CmludCBsZW5zdWI9TGVuZ3RoKHN1Yik7CmZvcihpbnQgaT0wO2k8cG9zO2krKykKewpyZXM9cmVzK3NbaV07Cn0KcmVzPXJlcytzdWI7CmZvcihpbnQgaT1wb3M7aTxsZW5zO2krKykKewpyZXM9cmVzK3NbaV07Cn0KcmV0dXJuIHJlczsKfQppbnQgbWFpbigpCnsKc3RyaW5nIHMsc3ViOwppbnQgcG9zOwpjaW4+PnM+PnN1Yj4+cG9zOwpzdHJpbmcgcmVzPUluc2VydEF0UG9zKHMscG9zLHN1Yik7CmNvdXQ8PHJlczw8ZW5kbDsKcmV0dXJuIDA7Cn0=