a=(input()) c=(input()) b=int(input()) for j in range(b): print(a) print(c)