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