I,R,P=input,range,print def J(): return map(int,I().split()) S=I() T=I() N=int(I()) P(S+("_"+T)*N)