You are given an integer sequence of length n, a_1, ..., a_n.
Let us consider performing the following n operations on an empty sequence b.
The i-th operation is as follows:
 - Append a_i to the end of b.
 - Reverse the order of the elements in b.
Find the sequence b obtained after these n operations.

-----Constraints-----
 - 1 \leq n \leq 2\times 10^5
 - 0 \leq a_i \leq 10^9
 - n and a_i are integers.

-----Input-----
Input is given from Standard Input in the following format:
n
a_1 a_2 ... a_n

-----Output-----
Print n integers in a line with spaces in between.
The i-th integer should be b_i.

-----Sample Input-----
4
1 2 3 4

-----Sample Output-----
4 2 1 3

 - After step 1 of the first operation, b becomes: 1.
 - After step 2 of the first operation, b becomes: 1.
 - After step 1 of the second operation, b becomes: 1, 2.
 - After step 2 of the second operation, b becomes: 2, 1.
 - After step 1 of the third operation, b becomes: 2, 1, 3.
 - After step 2 of the third operation, b becomes: 3, 1, 2.
 - After step 1 of the fourth operation, b becomes: 3, 1, 2, 4.
 - After step 2 of the fourth operation, b becomes: 4, 2, 1, 3.
Thus, the answer is 4 2 1 3.
[{"code": "n = int(input())\na = list(map(int, input().split()))\no = [a[i] for i in range(0,n,2)]\ne = [a[h] for h in range(1,n,2)]\nif n%2 == 0:\n    e.reverse()\n    l = e + o\n    print(*l)\nelse:\n    o.reverse()\n    l = o + e\n    print(*l)", "passed": true, "time": 0.34, "memory": 14088.0, "status": "done"}, {"code": "#!/usr/bin/env python3\nimport queue\n\n\ndef main():\n    n = int(input())\n    a = list(map(int, input().split()))\n    q = queue.deque()\n    for i in range(n):\n        if i % 2 == 1:\n            q.appendleft(a[i])\n        else:\n            q.append(a[i])\n    if n % 2 == 1:\n        q.reverse()\n    print(*q, sep=\" \")\n\n\ndef __starting_point():\n    main()\n\n__starting_point()", "passed": true, "time": 0.87, "memory": 14352.0, "status": "done"}, {"code": "n = int(input())\na = list(map(str, input().split()))\nb = []\n'''\nb = [str(a[0])]\nif (n == 1):\n    print(a[0])\n    return\n\na = a[1:]\n\nfor i in a:\n    b.append(str(i))\n    b.reverse()\n'''\n'''\nloop = int(n / 2)\nloop_rest = n - loop\n\nfor i in range(loop):\n    tar_index = (n - 1) - 2 * i\n    tar = a[tar_index]\n\n    b.append(str(tar))\n\n\nif (n % 2 == 0):\n    tar_index = 0\nelse:\n    tar_index = 1\n\nfor i in range(loop_rest):\n    b.append(str(a[tar_index]))\n    tar_index += 2\n'''\n\n# \u4e00\u3064\u304a\u304d\u3067List\u3092\u53d6\u308b\u5834\u5408\u3002\n# a[0::2]\n# 1\u3064\u76ee\uff1a\u8d77\u70b9\u3002\n# 2\u3064\u76ee\uff1aStep\n\n# a[::-1]\n# > -1step,\u3064\u307e\u308aReverse\n\nif n % 2 == 1:\n    print((\" \".join((a[0::2][::-1] + a[1::2]))))\nelse:\n    print((\" \".join((a[1::2][::-1] + a[0::2]))))\n", "passed": true, "time": 0.23, "memory": 14304.0, "status": "done"}, {"code": "n = int(input())\nl = list(map(int,input().split()))\nif n % 2 == 0:\n  a = l[::-2]+ l[0::2]\nelse:\n  a = l[::-2]+ l[1::2]\nprint(*a)", "passed": true, "time": 0.14, "memory": 14312.0, "status": "done"}, {"code": "n = int(input())\na = list(map(int, input().split()))\na1, a2 = [],[]\nfor index, i in enumerate(a, start=1):\n  if index % 2 == 0:\n    a2.append(i)\n  else:\n    a1.append(i)\n\nans = []\nif n % 2 == 0:\n  ans = a2[::-1] + a1\nelse:\n  ans = a1[::-1] + a2\n\nprint(\" \".join(str(i) for i in ans))", "passed": true, "time": 0.14, "memory": 14084.0, "status": "done"}, {"code": "n = int(input())\na = list(map(int,input().split()))\n\nb = [0] * n\n\nif n % 2 == 0 :\n    c = n//2 - 1\nelse :\n    c = n // 2\n\nb[c] = a[0]\n\nfor i in range(1,n) :\n    if i % 2 == 1 :\n        b[c + i] = a[i]\n        c += i\n    else :\n        b[c - i] = a[i]\n        c -= i\n\nif c != 0 :\n    b.reverse()\n    print(*b,sep=\" \")\nelse :\n    print(*b,sep=\" \")\n", "passed": true, "time": 0.14, "memory": 14200.0, "status": "done"}, {"code": "n = int(input())\na = list(map(int, input().split()))\n'''\nb = []\n\nfront = False\nfor i in a:\n    if front:\n        b.insert(0, i)\n        front = False\n    else:\n        b.append(i)\n        front = True\n\n\n\n\nif front:\n    b.reverse()\n\n\nb = list(map(str, b))\nb = \" \".join(b)\nprint(b)\n'''\n\n\nfirst = a[0:n:2]\nlast = a[1:n:2]\nlast = last[::-1]\nanswer = last + first\nif n%2 != 0:\n    answer = answer[::-1]\n\nprint(*answer, sep=\" \")", "passed": true, "time": 0.26, "memory": 14308.0, "status": "done"}, {"code": "from collections import deque\nn = int(input())\na = list(map(int,input().split()))\nans = deque()\ncheck = n % 2\nfor i in range(len(a)):\n  if (i + check) % 2 == 0:\n    ans.append(a[i])\n  else:\n    ans.appendleft(a[i])\nprint(*ans)", "passed": true, "time": 0.23, "memory": 14352.0, "status": "done"}, {"code": "from collections import deque\n\nb=deque()\n\nn=int(input())\na=[int(i) for i in input().split()]\n\nfor i in range(n):\n    if i%2==0:\n        b.append(a[i])\n    else:\n        b.appendleft(a[i])\nb=list(b)\n\nif n%2==1:\n    b=b[::-1]\nb=[str(i) for i in b]\n\nprint((\" \".join(b)))\n", "passed": true, "time": 0.15, "memory": 14232.0, "status": "done"}, {"code": "import math\nfrom math import gcd,pi,sqrt\nINF = float(\"inf\")\n\nimport sys\nsys.setrecursionlimit(10**6)\nimport itertools\nfrom collections import Counter,deque\ndef i_input(): return int(input())\ndef i_map(): return list(map(int, input().split()))\ndef i_list(): return list(i_map())\ndef i_row(N): return [i_input() for _ in range(N)]\ndef i_row_list(N): return [i_list() for _ in range(N)]\ndef s_input(): return input()\ndef s_map(): return input().split()\ndef s_list(): return list(s_map())\ndef s_row(N): return [s_input for _ in range(N)]\ndef s_row_str(N): return [s_list() for _ in range(N)]\ndef s_row_list(N): return [list(s_input()) for _ in range(N)]\n\nimport string\n\ndef main():\n    n = i_input()\n    a = i_list()\n    even = []\n    odd = []\n    for i,k in enumerate(a):\n        if i%2==0:\n            even.append(k)\n        else:\n            odd.append(k)\n\n    even.reverse()\n    even.extend(odd)\n    if n%2==0:\n        even.reverse()\n    print((\" \".join(map(str, even))))\n\n\n\ndef __starting_point():\n    main()\n\n__starting_point()", "passed": true, "time": 0.26, "memory": 14180.0, "status": "done"}, {"code": "import collections\nN = int(input())\nlsa = list(map(str,input().split()))\nlsb = collections.deque()\nif N%2 == 0:\n    for i in range(N):    \n        if i % 2 == 0:\n            lsb.append(lsa[i])\n        else:\n            lsb.appendleft(lsa[i])\nif N%2 == 1:\n    for i in range(N):\n        if i % 2 == 1:\n            lsb.append(lsa[i])\n        else:\n            lsb.appendleft(lsa[i])\n\nprint(' '.join(lsb))", "passed": true, "time": 0.23, "memory": 14120.0, "status": "done"}, {"code": "n = int(input())\nA = list(map(int, input().split()))\nb = [0]*n\nif n % 2 == 0:\n    k = 1\nelse:\n    k = -1\nindex_= int(n/2)\nfor i in range(n):\n    index_ += i * k\n    b[index_] = A[i]\n    k *= -1\nprint(*b)", "passed": true, "time": 0.18, "memory": 14204.0, "status": "done"}, {"code": "n=int(input())\na=list(map(int,input().split()))\nans=[]\nif n%2==1:\n    i=n\n    while i>=1:\n        ans.append(str(a[i-1]))\n        i-=2\n    i=2\n    while i<=n:\n        ans.append(str(a[i-1]))\n        i+=2\n    print(\" \".join(ans))\nelse:\n    i = n\n    while i >= 1:\n        ans.append(str(a[i - 1]))\n        i -= 2\n    i = 1\n    while i <= n:\n        ans.append(str(a[i - 1]))\n        i += 2\n    print(\" \".join(ans))", "passed": true, "time": 0.14, "memory": 14280.0, "status": "done"}, {"code": "n=int(input())\na=list(map(int,input().split()))\nodd=[]\neven=[]\nif n%2==0:\n  m=n//2\n  for i in range(m):\n    odd.append(a[n-1-2*i])\n    even.append(a[2*i])\n  print(*(odd+even))\nelse:\n  m=n//2\n  for i in range(m):\n    odd.append(a[n-1-2*i])\n    even.append(a[n-2-2*i])\n  even.reverse()\n  odd=odd+[a[0]]\n  print(*(odd+even))", "passed": true, "time": 0.15, "memory": 14168.0, "status": "done"}, {"code": "from collections import deque\n\n\ndef solve(a):\n    ans = deque()\n\n    for i, aa in enumerate(a):\n        if i % 2 == 0:\n            ans.append(str(aa))\n        else:\n            ans.appendleft(str(aa))\n\n    if len(a) % 2 == 1:\n        ans.reverse()\n\n    return list(ans)\n\n\ndef __starting_point():\n    n = int(input())\n    a = list(map(int, input().split()))\n    print((' '.join(solve(a))))\n\n__starting_point()", "passed": true, "time": 0.14, "memory": 14208.0, "status": "done"}, {"code": "n,a=int(input()),list(map(int,input().split()))\nprint(*[a[1::2][::-1]+a[::2],a[::2][::-1]+a[1::2]][n%2],sep=' ')", "passed": true, "time": 0.23, "memory": 14108.0, "status": "done"}, {"code": "from collections import deque\n\nn = int(input())\na = deque(list(map(int, input().split())))\nb = deque() if n % 2 == 0 else deque([a.popleft()])\nfor _ in range(n // 2):\n    b.append(a.popleft())\n    b.appendleft(a.popleft())\nprint(*b)", "passed": true, "time": 0.15, "memory": 14276.0, "status": "done"}, {"code": "n = int(input())\na_list = [int(x) for x in input().split()]\nprint(*(a_list[n-1::-2] + a_list[n % 2::2]))", "passed": true, "time": 0.16, "memory": 14276.0, "status": "done"}, {"code": "n = int(input())\na = list(map(int, input().split()))\n\na_even = a[0::2]\na_odd  = a[1::2] \n\n# even\nif (n - 1) % 2 == 0: # 0-(n-1)\u306e\u5b9f\u65bd\u306a\u306e\u3067(n-1)\u306e\u5076\u5947\u3092\u5224\u5b9a\n    b = a_even.copy()\n    b.reverse()\n    b = b + a_odd\n# odd\nelse:\n    b = a_odd.copy()\n    b.reverse()\n    b = b + a_even\n\nb = list(map(str, b))\nprint(' '.join(b))", "passed": true, "time": 0.18, "memory": 14076.0, "status": "done"}, {"code": "import collections\n\ndef f(myList):\n    ans = ''\n    if len(myList)%2==0:\n        for i in range(len(myList)):\n            ans += str(myList[i]) + ' '\n    else:\n        for i in range(len(myList)):\n            ans += str(myList[-(i+1)]) + ' '\n    return ans[:-1]\n\nn = int(input())\na = list(map(int,input().split()))\nb = collections.deque()\nfor i in range(n):\n    if i%2==0:\n        b.append(a[i])\n    else:\n        b.appendleft(a[i])\nprint((f(b)))\n", "passed": true, "time": 0.15, "memory": 14216.0, "status": "done"}, {"code": "n = int(input())\na = list(map(int, input().split()))\nfrom collections import deque\nd = deque()\n\n\nif len(a) %2 == 0:\n    d.extend(a[::2])\n    d.extendleft(a[1::2])\nelse:\n    d.extend(a[1::2])\n    d.extendleft(a[::2])\nprint(*list(d))", "passed": true, "time": 0.19, "memory": 14296.0, "status": "done"}, {"code": "from collections import deque\nn = int(input())\na = list(map(int,input().split()))\nb = deque()\nfor i in range(n):\n  if i%2==0:\n    b.append(a[i])\n  else:\n    b.appendleft(a[i])\nif n%2 ==0:\n  print(*list(b))\nelse:\n  print(*list(b)[::-1])", "passed": true, "time": 0.14, "memory": 14340.0, "status": "done"}, {"code": "n = int(input())\nL = list(map(int, input().split()))\n\nif n % 2 == 0:\n    A = L[n-1::-2] + L[::2]\nelse:\n    A = L[n-1::-2] + L[1::2]\n \nprint(*A)", "passed": true, "time": 0.14, "memory": 14132.0, "status": "done"}, {"code": "n = int(input())\na = list(map(int, input().split()))\n\nodd, even = a[::2], a[1::2]\n\nif n % 2 == 0:\n    ans = even[::-1] + odd\nelse:\n    ans = odd[::-1] + even\n\nprint(*ans)", "passed": true, "time": 0.15, "memory": 14320.0, "status": "done"}, {"code": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n#\n# FileName: \tC_fix\n# CreatedDate:  2020-10-08 14:55:40 +0900\n# LastModified: 2020-10-08 15:22:52 +0900\n#\n\n\nimport os\nimport sys\n# import numpy as np\n# import pandas as pd\n\n\ndef main():\n    N = int(input())\n    A = list(map(int, input().split()))\n    i = N-1\n\n    if N % 2 == 1:\n        while i < N:\n            if i == N-1:\n                print(\"{}\".format(A[i]), end='')\n            else:\n                print(\" {}\".format(A[i]), end='')\n            if i == 0:\n                i += 1\n                continue\n            if i % 2 == 0:\n                i -= 2\n            else:\n                i += 2\n\n    else:\n        while i < N:\n            if i == N-1:\n                print(\"{}\".format(A[i]), end='')\n            else:\n                print(\" {}\".format(A[i]), end='')\n            if i == 1:\n                i -= 1\n                continue\n            if i % 2 == 0:\n                i += 2\n            else:\n                i -= 2\n    print()\n\n\ndef __starting_point():\n    main()\n\n__starting_point()", "passed": true, "time": 0.3, "memory": 14380.0, "status": "done"}, {"code": "import sys \nfrom collections import deque\nN = int(input())\nA = list(map(int, input().split()))\n\n\nif N == 1:\n    print((A[0]))\n    return\n\nmae = deque()\nusiro = deque()\n\n#0\u306e\u6642\u306b\u524d 1\u306e\u6642\u306b\u5f8c\u308d\nFlag = 0\n\nfor i in reversed(list(range(0,N,1))):\n    \n    if Flag == 0: # \u524d\u306e\u6642\n        mae.append(str(A[i]))\n        mae.append(\" \")\n        Flag = 1\n    else:\n        usiro.insert(0,str(A[i]))\n        usiro.appendleft(\" \")\n        Flag = 0\n\nmoziretu = (mae + usiro)\ndel moziretu[((len(moziretu))//2)]\nmoziretu = ''.join(moziretu)\nprint(moziretu)\n  \n  \n\n\n", "passed": true, "time": 0.22, "memory": 14068.0, "status": "done"}, {"code": "n = int(input())\na = list(map(int,input().split()))\nb = []\nif n%2==0:\n    for i in range(n//2):\n        b.append(a[n-1-2*i])\n    for i in range(n//2):\n        b.append(a[2*i])\nelse:\n    for i in range((n+1)//2):\n        b.append(a[n-1-2*i])\n    for i in range((n-1)//2):\n        b.append(a[1+2*i])\nprint(*b)", "passed": true, "time": 0.19, "memory": 14288.0, "status": "done"}, {"code": "from collections import deque\nn=int(input())\na=list(map(int,input().split()))\nb=deque()\nfor i in range(n):\n  if i%2:\n    b.appendleft(a[i])\n  else:\n    b.append(a[i])\nif n%2:\n  print(*reversed(list(b)))\nelse:\n  print(*list(b))", "passed": true, "time": 0.14, "memory": 14340.0, "status": "done"}, {"code": "from collections import deque\n\nN=int(input())\na=list(map(int,input().strip().split()))\n\nb=deque()\nfor n in range(N):\n    if n%2==0:\n        b.append(a[n])\n    else:\n        b.appendleft(a[n])\nans=\" \".join(list(map(str,b))) if n%2==1 else \" \".join(list(map(str,list(deque(b))[::-1])))\nprint(ans)", "passed": true, "time": 0.14, "memory": 14384.0, "status": "done"}, {"code": "n = int(input())\na = list(map(int, input().split()))\no = [a[i] for i in range(2,n,2)]\ne = [a[h] for h in range(1,n,2)]\nif n%2 == 0:\n    e.reverse()\n    l = e + [a[0]] + o\n    print(*l)\nelse:\n    o.reverse()\n    l = o + [a[0]] + e\n    print(*l)", "passed": true, "time": 0.15, "memory": 14188.0, "status": "done"}, {"code": "n = int(input())\na = list(map(int, input().split()))\n\nif n % 2 == 0:\n    b = a[n-1::-2] + a[::2]\nelse:\n    b = a[n-1::-2] + a[1::2]\n\nprint(*b)", "passed": true, "time": 0.21, "memory": 14264.0, "status": "done"}, {"code": "#44 C - pushpush AC\nn = int(input())\na = list(map(int,input().split()))\n\nodd = [a[i] for i in range(n) if i%2 == 1] # O(n)\neven = [a[j] for j in range(n) if j%2 == 0]# O(n)\n\nif n%2 == 0:\n    ans = list(reversed(odd)) + even # O(n)\nelse:\n    ans = list(reversed(even)) + odd # O(n)\nprint(*ans)", "passed": true, "time": 0.35, "memory": 14108.0, "status": "done"}, {"code": "n = int(input())\na = list(map(int,input().split()))\nb = []\nif n%2 == 0:\n    for i in range(n-1,0,-2):\n        b.append(a[i])\n    for i in range(0,n-1,2):\n        b.append(a[i])\nelse:\n    for i in range(n-1,-1,-2):\n        b.append(a[i])\n    for i in range(1,n-1,2):\n        b.append(a[i])\nprint(*b)", "passed": true, "time": 0.15, "memory": 14104.0, "status": "done"}, {"code": "from collections import deque\nn = int(input())\na = list(map(int, input().split()))\nb = deque([])\nfor i in range(n):\n    if i % 2 == 0:\n        b.append(a[i])\n    else:\n        b.appendleft(a[i])\nif n % 2 == 0:\n    print(*list(b))\nelse:\n    print(*list(b)[::-1])", "passed": true, "time": 0.14, "memory": 14068.0, "status": "done"}, {"code": "n = int(input())\nA = [a for a in input().split(\" \")]\n\nif n == 1:\n  print(A[0])\nelse:\n  odd = A[::2]\n  even = A[1::2]\n  if n % 2 == 0:\n    even.reverse()\n    print(\" \".join(even + odd))\n  else:\n    odd.reverse()\n    print(\" \".join(odd + even))", "passed": true, "time": 0.14, "memory": 14048.0, "status": "done"}, {"code": "n = int(input())\na = input().split()\n \nif n % 2 == 1:\n    print(\" \".join((a[0::2][::-1] + a[1::2])))\nelse:\n    print(\" \".join((a[1::2][::-1] + a[0::2])))", "passed": true, "time": 0.23, "memory": 14356.0, "status": "done"}, {"code": "N = int(input())\na = list(map(int,input().split()))\n\nb = [0]*N \n\nif N % 2 == 0:\n    even = N//2\n    odd = even - 1\n    for i in range(N):\n        if i % 2 == 0:\n            b[even] = str(a[i])\n            even += 1\n        else:\n            b[odd] = str(a[i])\n            odd -= 1\nelse:\n    even = N//2\n    odd = even + 1\n    for i in range(N):\n        if i % 2 == 0:\n            b[even] = str(a[i])\n            even -= 1\n        else:\n            b[odd] = str(a[i])\n            odd += 1\n\nprint((' '.join(b)))\n", "passed": true, "time": 0.14, "memory": 14324.0, "status": "done"}, {"code": "n=int(input())\na=list(map(int,input().split()))\n\nodd,even=a[::2],a[1::2]\n\nif n%2==0:\n  ans=even[::-1]+odd\nelse:\n  ans=odd[::-1]+even\n\nprint(*ans)", "passed": true, "time": 0.23, "memory": 14200.0, "status": "done"}, {"code": "N = int(input())\nA = list(map(int,input().split()))\n\n# 0\n# 1, 0\n# 2, 0, 1\n# 3, 1, 0, 2\n# 4, 2 ,0, 1, 3\n\nans = None\nif N % 2 == 1:\n  ans = A[::2][::-1] + A[1::2]\nelse:\n  ans = A[1::2][::-1] + A[::2]\nprint(*ans)", "passed": true, "time": 0.14, "memory": 14200.0, "status": "done"}, {"code": "N=int(input())\nA=list(map(int,input().split()))\nprint(*A[::-2],*A[N%2::2])", "passed": true, "time": 0.14, "memory": 14228.0, "status": "done"}, {"code": "from collections import deque\n\n\nN = int(input())\nAS = [int(i) for i in input().split()]\n\nb = deque()\n\nx = 0 if len(AS) % 2 == 0 else 1\n\nfor i, a in enumerate(AS):\n  if i % 2 == x:\n    b.append(str(a))\n  else:\n    b.appendleft(str(a))\n\nprint((' '.join(list(b))))\n", "passed": true, "time": 0.33, "memory": 14136.0, "status": "done"}, {"code": "n = int(input())\na = list(map(int,input().split()))\n\nq = a[::2]\np = a[1::2]\n\nif n%2 == 0:\n  print(*p[::-1],*q)\nelse:\n  print(*q[::-1],*p)", "passed": true, "time": 0.14, "memory": 14312.0, "status": "done"}, {"code": "n,a=int(input()),list(map(int,input().split()))\nprint(*[a[1::2][::-1]+a[::2],a[0::2][::-1]+a[1::2]][n%2],sep=' ')", "passed": true, "time": 0.22, "memory": 14076.0, "status": "done"}, {"code": "n = int(input())\na = list(map(int, input().split()))\n\nb = []\nif n%2 == 1:\n    for i in a[n-1:0:-2]:\n        b.append(\"{0}\".format(i))\n    b.append(str(a[0]))\n    for i in a[1:n:2]:\n        b.append(\"{0}\".format(i))\n\nif n%2 == 0:\n    for i in a[n-1:0:-2]:\n        b.append(\"{0}\".format(i))\n    for i in a[0:n:2]:\n        b.append(\"{0}\".format(i))\n\nprint((' '.join(b)))\n", "passed": true, "time": 0.14, "memory": 14304.0, "status": "done"}, {"code": "from collections import deque\nn = int(input())\na = list(map(int,input().split()))\nb = deque()\nfor i in range(n):\n  if i%2==0:\n    b.append(a[i])\n  else:\n    b.appendleft(a[i])\nif n%2==0:\n  print(*b)\nelse:\n  print(*reversed(b))", "passed": true, "time": 0.2, "memory": 14344.0, "status": "done"}, {"code": "N=int(input())\n*A,=map(int,input().split())\n\nif N%2==0:\n    print(' '.join(map(str,A[1::2][::-1]+A[::2])))\nelse:\n    print(' '.join(map(str,A[::2][::-1]+A[1::2])))", "passed": true, "time": 0.15, "memory": 14228.0, "status": "done"}, {"code": "n = 4\na = [1, 2, 3, 4]\n\nn = int(input())\na = input().split()\n\n\nif n % 2 == 0:\n    y = [a[j] for j in range(1, n, 2)][::-1]\n    z = [a[j] for j in range(0, n, 2)]\n\nelse:\n    y = [a[j] for j in range(0, n, 2)][::-1]\n    z = [a[j] for j in range(1, n, 2)]\n\nprint((\" \".join(map(str, y + z))))\n", "passed": true, "time": 0.22, "memory": 14208.0, "status": "done"}, {"code": "from collections import deque\nn = int(input())\na = list(map(int, input().split()))\nb = deque()\nreverse = 1\nfor i in range(n):\n    if reverse == 1:\n        b.append(a[i])\n        reverse *= -1\n    else:\n        b.appendleft(a[i])\n        reverse *= -1\n\nb_list = list(b)\nif reverse == 1:\n    print(*b_list)\nelse:\n    print(*b_list[::-1])", "passed": true, "time": 0.16, "memory": 14256.0, "status": "done"}, {"code": "from collections import deque\n\nn = int(input())\na = list(map(int, input().split()))\nb = deque()\nflip = False\nfor i, x in enumerate(a):\n  if flip:\n    b.appendleft(x)\n  else:\n    b.append(x)\n  flip = not flip\n\nif flip:\n  b = list(reversed(b))\nprint(*b)  ", "passed": true, "time": 0.14, "memory": 14356.0, "status": "done"}, {"code": "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Sun Sep 27 02:46:15 2020\n\n@author: liang\n\"\"\"\n\nfrom collections import deque\n\nn = int(input())\nA = [int(x) for x in input().split()]\n\nres = deque()\n\nfor i in range(n):\n    if i % 2 == 0:\n        res.append(A[i])\n    else:\n        res.appendleft(A[i])\n        \nif n % 2 == 1:\n    print(\" \".join(map(str,reversed(res))))\nelse:\n    print(\" \".join(map(str,res)))", "passed": true, "time": 0.22, "memory": 14100.0, "status": "done"}, {"code": "from collections import deque\nn = int(input())\n#a, b, c = map(int, input().split())\nal = list(map(int, input().split()))\n#l = [list(map(int,input().split())) for i in range(n)]\n\nq = deque([])\n\nfor i in range(1, n+1):\n    if i % 2 == 0:\n        q.appendleft(al[i-1])\n    else:\n        q.append(al[i-1])\n\nansl = list(q)\nansl = ansl[::-1] if n % 2 != 0 else ansl\n\nprint(*ansl, sep=\" \")\n", "passed": true, "time": 0.19, "memory": 14096.0, "status": "done"}, {"code": "from collections import deque\n\nn = int(input())\na_s = list(map(int, input().split()))\n\nd = deque()\n\nfor i in range(n):\n    if i % 2 == 0:\n        d.append(a_s[i])\n    else:\n        d.appendleft(a_s[i])\n\nif n%2==1:\n    d.reverse()\n\nprint((' '.join(map(str, d))))\n", "passed": true, "time": 0.14, "memory": 14232.0, "status": "done"}, {"code": "n = int(input())\na = list(map(int,input().split()))\n\nb = [-1] * n\nl = 0\nr = n-1\nfor i in range(n-1, -1, -1):\n    if i % 2:\n        b[l] = a[i]\n        l += 1\n    else:\n        b[r] = a[i]\n        r -= 1\n\nif n % 2:\n    b.reverse()\nb = [str(i) for i in b]\nprint(' '.join(b))", "passed": true, "time": 0.15, "memory": 14204.0, "status": "done"}, {"code": "n=int(input())\na=list(input().split())\nfrom collections import deque\nb=deque()\nif n%2==0:\n    for i in range(n):\n        if i%2==0:\n            b.append(a[i])\n        else:\n            b.appendleft(a[i])\nelse:\n    for i in range(n):\n        if i%2==0:\n            b.appendleft(a[i])\n        else:\n            b.append(a[i])\nB=[]\nfor i in range(n):\n    B.append(b.popleft())\nprint(\" \".join(B))", "passed": true, "time": 0.14, "memory": 14180.0, "status": "done"}, {"code": "'''\nCreated on 2020/08/28\n\n@author: harurun\n'''\ndef main():\n  from collections import deque\n  import sys\n  pin=sys.stdin.readline\n  pout=sys.stdout.write\n  perr=sys.stderr.write\n  \n  n=int(pin())\n  a=list(map(int,pin().split()))\n  b=deque([])\n  if n%2==0:\n    for i in range(n):\n      if i%2==0:\n        b.append(a[i])\n      else:\n        b.appendleft(a[i])\n  else:\n    for j in range(n):\n      if j%2==0:\n        b.appendleft(a[j])\n      else:\n        b.append(a[j])\n  for k in range(n):\n    pout(str(b[k]))\n    if k!=n-1:\n      pout(\" \")\n  pout(\"\\n\")\n  return \nmain()\n", "passed": true, "time": 0.14, "memory": 14260.0, "status": "done"}, {"code": "n = int(input())\na = [int(x) for x in input().split()]\nb = []\n\nif n % 2 == 0:\n  i = n-1\n  while i >= 0:\n    b.append(a[i])\n    i -= 2\n  i = 0\n  while i < n:\n    b.append(a[i])\n    i += 2\nelse:\n  i = n-1\n  while i >= 0:\n    b.append(a[i])\n    i -= 2\n  i = 1\n  while i < n:\n    b.append(a[i])\n    i += 2\n\nb = [str(x) for x in b]\nprint(\" \".join(b))", "passed": true, "time": 0.14, "memory": 14068.0, "status": "done"}, {"code": "n = int(input())\na = [ int(x) for x in input().split() ]\n\nl = []\nif n % 2 == 1:\n    i = n-1\n    while i >= 0:\n        l.append(a[i])\n        i -= 2\n\n    j = 1\n    while j < n:\n        l.append(a[j])\n        j += 2\nelse:\n    i = n-1\n    while i >= 0:\n        l.append(a[i])\n        i -= 2\n\n    j = 0\n    while j < n:\n        l.append(a[j])\n        j += 2\n\nprint((' '.join(map(str, l))))\n", "passed": true, "time": 0.14, "memory": 14200.0, "status": "done"}, {"code": "n = int(input())\na_list = [int(x) for x in input().split()]\nif n % 2 == 0:\n    b_list = a_list[n-1::-2] + a_list[0::2]\nelse:\n    b_list = a_list[n-1::-2] + a_list[1::2]\nprint(*b_list)", "passed": true, "time": 0.14, "memory": 14176.0, "status": "done"}, {"code": "def main():\n    n = int(input())\n    a_lst = list(map(int, input().split()))\n    lst1 = []\n    lst2 = []\n\n    if n % 2 == 0:\n        for i in range(n // 2):\n            lst1.append(a_lst[-1 - i * 2])\n        for i in range(n // 2):\n            lst2.append(a_lst[i * 2])\n\n    else:\n        for i in range(n // 2):\n            lst1.append(a_lst[-1 - i * 2])\n        lst2.append(a_lst[0])\n        for i in range(n // 2):\n            lst2.append(a_lst[1 + i * 2])\n\n    lst = lst1 + lst2\n    ans = ''\n    for i in range(n - 1):\n        ans += '{} '.format(lst[i])\n    ans += '{}'.format(lst[-1])\n    print(ans)\n\n\ndef __starting_point():\n    main()\n__starting_point()", "passed": true, "time": 0.14, "memory": 14108.0, "status": "done"}, {"code": "n = int(input())\na_list = [int(x) for x in input().split()]\nb = []\nc = []\nfor i, a in enumerate(a_list):\n    if i % 2 == 0:\n        b.append(a)\n    else:\n        c.append(a)\nif n % 2 == 0:\n    d = list(reversed(c)) + b\nelse:\n    d = list(reversed(b)) + c\nprint(*d)", "passed": true, "time": 0.14, "memory": 14184.0, "status": "done"}, {"code": "n = int(input())\na_list = [int(x) for x in input().split()]\nprint(*(a_list[::-2] + a_list[n&1::2]))", "passed": true, "time": 0.14, "memory": 14080.0, "status": "done"}, {"code": "# coding: utf-8\nimport math\nfrom collections import deque\nn = int(input())\n#x, y = map(int,input().split())\nA = list(map(int,input().split()))\nans = 0\nB = deque()\nif n%2==0:\n    for i in range(n):\n        a=str(A[i])\n        if i%2==1:\n            B.appendleft(a)\n        else:\n            B.append(a)\nif n%2==1:\n    for i in range(n):\n        a=str(A[i])\n        if i%2==0:\n            B.appendleft(a)\n        else:\n            B.append(a)\nprint(' '.join(B))", "passed": true, "time": 0.14, "memory": 14128.0, "status": "done"}, {"code": "n,a=int(input()),list(map(int,input().split()))\nb=[a[1::2][::-1]+a[::2],a[0::2][::-1]+a[1::2]][n%2]\nprint(*b,sep=' ')", "passed": true, "time": 0.14, "memory": 14200.0, "status": "done"}, {"code": "from collections import deque\nn = int(input())\na = list(map(int, input().split()))\nb = deque()\n\nfor i in range(n):\n    if i%2 == 0:\n        b.append(a[i])\n    else:\n        b.appendleft(a[i])\nif n%2 == 1:\n    b.reverse()\nprint(*b, sep=' ')\n", "passed": true, "time": 0.14, "memory": 14336.0, "status": "done"}, {"code": "N=int(input())\nA=list(map(int,input().split()))\nprint(*A[::-2],*A[N%2::2])", "passed": true, "time": 0.14, "memory": 14220.0, "status": "done"}, {"code": "from collections import deque\n\nn = int(input())\na = list(map(int, input().split()))\nb = deque()\n\nfor i in range(n):\n    if i % 2 == 0:\n        b.append(a[i])\n    else:\n        b.appendleft(a[i])\n\nif n % 2 == 1:\n    b.reverse()\n\nprint((\" \".join(map(str, b))))\n", "passed": true, "time": 0.16, "memory": 14280.0, "status": "done"}, {"code": "from collections import deque\nn,a,b=int(input()),deque(map(int,input().split())),deque()\nfor i in range(n):\n  if n%2==0:\n    if i%2==0:\n      b.append(a[i])\n    else:\n      b.appendleft(a[i])\n  else:\n    if i%2==0:\n      b.appendleft(a[i])\n    else:\n      b.append(a[i])\nprint(*b,sep=' ')", "passed": true, "time": 0.14, "memory": 14284.0, "status": "done"}, {"code": "n=int(input())\na=list(map(str,input().split()))\nb,c=[],[]\nif n%2==0:\n    for i in range(n):\n        if i%2==0:\n            b.append(a[i])\n        else:\n            c.append(a[i])\n    c.reverse()\nelse:\n    for i in range(n):\n        if i%2==1:\n            b.append(a[i])\n        else:\n            c.append(a[i])\n    c.reverse()\nprint(\" \".join(c+b))", "passed": true, "time": 0.14, "memory": 14208.0, "status": "done"}, {"code": "N = int(input())\nA = list(map(int,input().split()))\n\n# 0\n# 1, 0\n# 2, 0, 1\n# 3, 1, 0, 2\n# 4, 2 ,0, 1, 3\n\nfront = []\nback = []\n\nfor i in range(N):\n  if i % 2 == 0:\n    back.append(A[i])\n  else:\n    front.append(A[i])\n    \nans = None\nif N % 2 == 0:\n  ans = front[::-1] + back\nelse:\n  ans = back[::-1] + front\n  \nprint(*ans)", "passed": true, "time": 0.14, "memory": 14124.0, "status": "done"}, {"code": "n = int(input())\naa = list(map(int, input().split()))\nif n % 2 == 0:\n  a = aa[n-1:0:-2]+aa[0:n-1:2]\nelse:\n  a = aa[n-1::-2]+aa[1:n-1:2]\nprint(*a)", "passed": true, "time": 0.14, "memory": 14136.0, "status": "done"}, {"code": "n = int(input())\nA = list(input().split())\n\nif (n - 1) % 2 == 0:\n  top = [\"\"] * ((n - 1) // 2)\n  bottom = [\"\"] * ((n - 1) // 2)\n    \n  t = (n - 1) // 2 - 1\n  b = 0\n  for i in range(1,n):\n    if i % 2 == 1:\n      bottom[b] = A[i]\n      b += 1\n    else:\n      top[t] = A[i]\n      t -= 1\nelse:\n  top = [\"\"] * ((n - 1) // 2 + 1)\n  bottom = [\"\"] * ((n - 1) // 2)\n  \n  t = (n - 1) // 2\n  b = 0\n  \n  for j in range(1,n):\n    if j % 2 == 1:\n      top[t] = A[j]\n      t -= 1\n    else:\n      bottom[b] = A[j]\n      b += 1\n      \nprint(*(top + [A[0]] + bottom))", "passed": true, "time": 0.14, "memory": 14276.0, "status": "done"}, {"code": "n=int(input())\na=list(map(int,input().split()))\n\neven = [a[i] for i in range(1,n,2)]\nodd = [a[i] for i in range(0,n,2)]\n\nif n % 2 == 0:\n  print(*(even[::-1]+odd))\nelse:\n  print(*(odd[::-1]+even))", "passed": true, "time": 0.14, "memory": 14184.0, "status": "done"}, {"code": "from collections import deque\nn = int(input())\na = list(map(int,input().split()))\nb_1 = deque()\nb_2 = deque()\nswitch = 0\nfor i in a:\n    if switch == 0:\n        b_1.append(i)\n        b_2.appendleft(i)\n        switch = 1\n    else:\n        b_2.append(i)\n        b_1.appendleft(i)\n        switch = 0\nb_1 = list(b_1)\nb_2 = list(b_2)\nif switch == 0:\n    print((' '.join(list(map(str,b_1)))))\nelse:\n    print((' '.join(list(map(str,b_2)))))\n", "passed": true, "time": 0.14, "memory": 14136.0, "status": "done"}]