S = input() T = input() N = int(input()) ans = [S] for _ in range(N): ans.append("_") ans.append(T) print("".join(ans))