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