from sys import stdin input=lambda :stdin.readline()[:-1] s=input() t=input() n=int(input()) for i in range(n): s+='_'+t print(s)