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