s=input() t=input() n=int(input()) print(s, *[t for i in range(n)], sep="_")