n = eval(input())

a = input().split()

print((" ".join(a[::-1])))
eval(input())

a = input().split()

print((" ".join(a[::-1])))
n = eval(input())
a = input().split()
print((" ".join(a[::-1])))

eval(input())
a = input().split()
print((" ".join(a[::-1])))

-n = eval(input()) +eval(input())