A=input() B=input() N=int(input()) C=('_'+B) D=(C*N) print(A+D)