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