def I(): return input() def N(): return int(input()) def M(): return map(int,input().split()) def L(): return list(map(int,input().split())) #----------------------------------------- s = I() t = I() N = N() print(s,end = "") for i in range(N): print("_",end="") print(t,end="")