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