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