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