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