S=input() T=input() N=int(input()) for i in range(N): S+='_'+T print(S)