import collections

n,rev,q = int(input()) ,False,collections.deque()



class Node(object):

	def __init__(self, val):

		self.val = val

		self.next = None

		self.prev = None



head = None

tail = None

for ai in map(int, input().split()):

	if head is None:

		node = Node(ai)

		head = node

		tail = node

	else:

		node = Node(ai)

		if rev:

			head.prev = node

			node.next= head

			head = node

		else:

			tail.next = node

			node.prev=  tail

			tail = node

		rev ^=  True



cur = head 

temp = []

while(cur):

	temp.append(cur.val)

	cur = cur.__next__ 

print(' '.join(map(str, temp[::-1 if rev else 1])))
import collections

n,rev = int(input()) ,False

class Node(object):

	def __init__(self, val):

		self.val = val

		self.next, self.prev = None, None



for i,ai in enumerate(map(int, input().split())):

	node = Node(ai)		

	if i  == 0:

		head,tail = node,node

	else:

		if rev:

			head.prev, node.next = node, head

			head = node

		else:

			tail.next, node.prev = node, tail

			tail = node

		rev ^=  True



cur = head if not(rev) else tail  

while(cur):

	print(cur.val, end=' ') 

	cur = cur.__next__ if not(rev) else cur.prev

import collections

n, rev, q = int(input()), False, collections.deque()


class Node(object):
    def __init__(self, val):
        self.val = val
        self.next = None
        self.prev = None


head = None
tail = None
for ai in map(int, input().split()):
    if head is None:
        node = Node(ai)
        head = node
        tail = node
    else:
        node = Node(ai)
        if rev:
            head.prev = node
            node.next = head
            head = node
        else:
            tail.next = node
            node.prev = tail
            tail = node
        rev ^= True
cur = head
temp = []
while cur:
    temp.append(cur.val)
    cur = cur.__next__
print(" ".join(map(str, temp[:: -1 if rev else 1])))

import collections

n, rev = int(input()), False


class Node(object):
    def __init__(self, val):
        self.val = val
        self.next, self.prev = None, None


for i, ai in enumerate(map(int, input().split())):
    node = Node(ai)
    if i == 0:
        head, tail = node, node
    else:
        if rev:
            head.prev, node.next = node, head
            head = node
        else:
            tail.next, node.prev = node, tail
            tail = node
        rev ^= True
cur = head if not (rev) else tail
while cur:
    print(cur.val, end=" ")
    cur = cur.__next__ if not (rev) else cur.prev

-n, rev, q = int(input()), False, collections.deque() +n, rev = int(input()), False -        self.next = None -        self.prev = None +        self.next, self.prev = None, None -head = None -tail = None -for ai in map(int, input().split()): -    if head is None: -        node = Node(ai) -        head = node -        tail = node +for i, ai in enumerate(map(int, input().split())): +    node = Node(ai) +    if i == 0: +        head, tail = node, node -        node = Node(ai) -            head.prev = node -            node.next = head +            head.prev, node.next = node, head -            tail.next = node -            node.prev = tail +            tail.next, node.prev = node, tail -cur = head -temp = [] +cur = head if not (rev) else tail -    temp.append(cur.val) -    cur = cur.__next__ -print(" ".join(map(str, temp[:: -1 if rev else 1]))) +    print(cur.val, end=" ") +    cur = cur.__next__ if not (rev) else cur.prev