s=input() t=input() n = int(input()) for i in range(n): s+='_'+t print(s)