S = input() T = input() N = int(input()) for n in range(N): S += "_" S += T print(S)