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