x = eval(input())

a = []

b = input().split()

for i in b:

    a.append(i)

a.reverse()

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

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

a.reverse()

print((" ".join(a)))
x = eval(input())
a = []
b = input().split()
for i in b:
    a.append(i)
a.reverse()
print((" ".join(a)))

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

-x = eval(input()) -a = [] -b = input().split() -for i in b: -    a.append(i) +eval(input()) +a = list(input().split())