#!/bin/python3
import sys
n = int(input().strip())
arr = [int(arr_temp) for arr_temp in input().strip().split(' ')]
print(" ".join(str(x) for x in arr[::-1]))
print(" ".join(map(str, arr[::-1]))) # or
print(' '.join(map(str, reversed(arr)))) # or
## Script (Python) "getTranslatedRefs"
##title=Gets translated refs, backrefs, or both for a given relationship.
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=rel,which,sort_on=None,sort_type=None,sort_order=None
if which == "refs":
refs = context.getCanonical().getRefs(relationship=rel)
elif which == "brefs":
refs = context.getCanonical().getBRefs(relationship=rel)
elif which == "all":
refs = context.getCanonical().getRefs(relationship=rel) + \
context.getCanonical().getBRefs(relationship=rel)
else:
raise "Invalid 'which' parameter %s - must be 'refs','brefs' or 'all'."
unique = []
for b in refs:
canonical = b.getCanonical()
if canonical not in unique:
unique.append(canonical)
translated = [i.getTranslation(context.getLanguage()) or i for i in unique]
if sort_on:
results = sequence.sort(translated,((sort_on, sort_type, sort_order),))
else:
results = translated
return results