Buggy python submission (verdict: Time Limit Exceeded):
def solve():
  n = int(input())
  a = list(map(int, input().split()))
  b = []
  for i in range(n):
    if i % 2 == n % 2:
      b.append(a[i])
    else:
      b.insert(0,a[i])
  b = map(str, b)
  print(" ".join(b))
  return 0
 
if __name__ == "__main__":
  solve()

Fixed submission:
import math
import collections
import fractions
import itertools

def solve():
    n = int(input())
    a = list(map(int, input().split()))
    deq = collections.deque()
    for i in range(n):
        if i % 2 == 0:
            deq.append(str(a[i]))
        else:
            deq.appendleft(str(a[i]))
    if n % 2 == 1:
        deq.reverse()
    print(" ".join(deq))
    return 0

if __name__ == "__main__":
    solve()

Buggy python submission (verdict: Runtime Error):
import collections
def solve():
  n = int(input())
  a = list(map(int, input().split()))
  b = collections.deque()
  for i in range(n):
    if i % 2 == n % 2:
      b.append(a[i])
    else:
      b.insert(0,a[i])
  b = map(str, b)
  print(" ".join(b))
  return 0
 
if __name__ == "__main__":
  solve()


Fixed submission:
import math
import collections
import fractions
import itertools

def solve():
    n = int(input())
    a = list(map(int, input().split()))
    deq = collections.deque()
    for i in range(n):
        if i % 2 == 0:
            deq.append(str(a[i]))
        else:
            deq.appendleft(str(a[i]))
    if n % 2 == 1:
        deq.reverse()
    print(" ".join(deq))
    return 0

if __name__ == "__main__":
    solve()

Buggy python submission (verdict: Runtime Error):
import numpy as np
import functools
import math
import collections
import scipy
import fractions
import itertools

def solve():
  n = int(input())
  a = list(map(int, input().split()))
  b = collections.deque()
  for i in range(n):
    if i % 2 == n % 2:
      b.append(a[i])
    else:
      b.insert(0,a[i])
  b = map(str, b)
  print(" ".join(b))
  return 0
 
if __name__ == "__main__":
  solve()


Fixed submission:
import math
import collections
import fractions
import itertools

def solve():
    n = int(input())
    a = list(map(int, input().split()))
    deq = collections.deque()
    for i in range(n):
        if i % 2 == 0:
            deq.append(str(a[i]))
        else:
            deq.appendleft(str(a[i]))
    if n % 2 == 1:
        deq.reverse()
    print(" ".join(deq))
    return 0

if __name__ == "__main__":
    solve()

Buggy python submission (verdict: Runtime Error):
import numpy as np
import functools
import math
import collections
import scipy
import fractions
import itertools

def solve():
  n = int(input())
  a = list(map(int, input().split()))
  b = collections.deque()
  for i in range(n):
    if i % 2 == 1:
      b.insert(0,a[i])
    else:
      b.append(a[i])
  b = map(str, b)
  print(" ".join(b))
  return 0
 
if __name__ == "__main__":
  solve()


Fixed submission:
import math
import collections
import fractions
import itertools

def solve():
    n = int(input())
    a = list(map(int, input().split()))
    deq = collections.deque()
    for i in range(n):
        if i % 2 == 0:
            deq.append(str(a[i]))
        else:
            deq.appendleft(str(a[i]))
    if n % 2 == 1:
        deq.reverse()
    print(" ".join(deq))
    return 0

if __name__ == "__main__":
    solve()