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