S = list(input()) T = list(input()) N = int(input()) ans = S for i in range(N): ans.append("_") ans.extend(T) print(*ans, sep="")