eval(input())

a = list(input().split())

a.reverse()

print((" ".join(a)))
eval(input())

print((" ".join(reversed(input().split()))))
eval(input())
a = list(input().split())
a.reverse()
print((" ".join(a)))

eval(input())
print((" ".join(reversed(input().split()))))

-a = list(input().split()) -a.reverse() -print((" ".join(a))) +print((" ".join(reversed(input().split()))))