#include <stdio.h>
#include <string.h>

void insert (char *s,  char  *t,  int i)
{
	char string[300],  *temp =string;
	
	if  (!strlen (s))
		strcpy (s,  t);
	else   if (strlen (t))  {
		strncpy (temp, s, i);
		strcat (temp, t) ;
		strcat (temp,  (s + i ));
		strcpy (s, temp );
	}
}
int main ()
{
	char s[128];
	char t[128];
  int i;
  scanf("%s %s %d",s,t,&i);
	insert(s,t,i-1);
	printf("%s",s);
	printf ("\n");
}

/**************************************************************
	Problem: 2149
	User: admin
	Language: C
	Result: Wrong Answer
****************************************************************/