s = input() t = input() n = int(input()) ans = s for i in range(n): ans += "_" ans += t print(ans)