#include <iostream>
#include <string.h>
#include <stdio.h>
using namespace std;
#define MAX 300
int myStrlen(char s[], int k);
void myStrcpy(char s[], int vt, char s1[], int k);
void mySubstr(char s[], int b, int count, char ss[]);
bool myStrcat(char s1[], char s2[]);
void ChenChuoiTaiVitriK(char s[], char s1[], int k);
int main()
{
char s[MAX], s1[MAX];
fgets(s,MAX,stdin);
fgets(s1,MAX,stdin);
int k;
cin >> k;
if (k < 0 || k>myStrlen(s, 0))
cout << "Vi tri " << k << " khong thoa dieu kien." << endl;
else
{
for (int i = 0; i<k ; i++) cout << s[i];
for (int i = 0; i<myStrlen(s1,0) ; i++) cout << s1[i];
for (int i = k; i<myStrlen(s,0) ; i++) cout << s[i];
}
return 0;
}
int myStrlen(char s[], int k){
int dem = 0;
for (int i=0;s[i]!='\0';i++) ++dem;
return dem-1;
}
CiNpbmNsdWRlIDxpb3N0cmVhbT4KI2luY2x1ZGUgPHN0cmluZy5oPgojaW5jbHVkZSA8c3RkaW8uaD4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKI2RlZmluZSBNQVggMzAwCgppbnQgbXlTdHJsZW4oY2hhciBzW10sIGludCBrKTsKdm9pZCBteVN0cmNweShjaGFyIHNbXSwgaW50IHZ0LCBjaGFyIHMxW10sIGludCBrKTsKdm9pZCBteVN1YnN0cihjaGFyIHNbXSwgaW50IGIsIGludCBjb3VudCwgY2hhciBzc1tdKTsKYm9vbCBteVN0cmNhdChjaGFyIHMxW10sIGNoYXIgczJbXSk7CnZvaWQgQ2hlbkNodW9pVGFpVml0cmlLKGNoYXIgc1tdLCBjaGFyIHMxW10sIGludCBrKTsKCmludCBtYWluKCkKewoJY2hhciBzW01BWF0sIHMxW01BWF07CglmZ2V0cyhzLE1BWCxzdGRpbik7CglmZ2V0cyhzMSxNQVgsc3RkaW4pOwoJaW50IGs7CgljaW4gPj4gazsKCWlmIChrIDwgMCB8fCBrPm15U3RybGVuKHMsIDApKQoJCWNvdXQgPDwgIlZpIHRyaSAiIDw8IGs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