s = input() t = input() n = int(input()) for i in range(n): s += "_" s += t print(s)