Buggy python submission (verdict: Time Limit Exceeded):
def main2():
    N = int(input().strip())
    r_stack=[]
    stack=[]
    for n in input().split():
        n = int(n)
        if len(r_stack)%2!=0:
            stack.append(n)
            r_stack.insert(0,n)
        else:
            stack.insert(0,n)
            r_stack.append(n)
    if N % 2 ==0:
        print(*r_stack)
    else:
        print(*stack)

if __name__ == "__main__":
    main2()

Fixed submission:
from collections import deque
def main3():
    d = deque()
    rd= deque()
    N = int(input().strip())
    for n in input().split():
        if len(rd)%2!=0:
            d.append(n)
            rd.appendleft(n)
        else:
            rd.append(n)
            d.appendleft(n)
    if N % 2 ==0:
        print(*rd)
    else:
        print(*d)

if __name__ == "__main__":
    main3()

Buggy python submission (verdict: Time Limit Exceeded):
def main2():
    N = int(input().strip())
    r_stack=[]
    stack=[]
    for n in input().split():
        n = int(n)
        if len(r_stack)==0:
            stack.append(n)
            r_stack.append(n)
        elif len(r_stack)%2!=0:
            stack.append(n)
            r_stack.insert(0,n)
        else:
            stack.insert(0,n)
            r_stack.append(n)
    if N % 2 ==0:
        print(*r_stack)
    else:
        print(*stack)

if __name__ == "__main__":
    main2()

Fixed submission:
from collections import deque
def main3():
    d = deque()
    rd= deque()
    N = int(input().strip())
    for n in input().split():
        if len(rd)%2!=0:
            d.append(n)
            rd.appendleft(n)
        else:
            rd.append(n)
            d.appendleft(n)
    if N % 2 ==0:
        print(*rd)
    else:
        print(*d)

if __name__ == "__main__":
    main3()

Buggy python submission (verdict: Time Limit Exceeded):
def main2():
    N = int(input().strip())
    r_stack=[]
    stack=[]
    for n in input().split():
        n = int(n)
        if len(r_stack)==0:
            stack.append(n)
            r_stack.append(n)
        elif len(r_stack)%2!=0:
            stack.append(n)
            r_stack.insert(0,n)
        else:
            stack.insert(0,n)
            r_stack.append(n)
    if N % 2 ==0:
        ans_list=[str(num) for num in r_stack]
        ans=' '.join(ans_list)
    else:
        ans_list=[str(num) for num in stack]
        ans=' '.join(ans_list)
    print(ans)

if __name__ == "__main__":
    main2()

Fixed submission:
from collections import deque
def main3():
    d = deque()
    rd= deque()
    N = int(input().strip())
    for n in input().split():
        if len(rd)%2!=0:
            d.append(n)
            rd.appendleft(n)
        else:
            rd.append(n)
            d.appendleft(n)
    if N % 2 ==0:
        print(*rd)
    else:
        print(*d)

if __name__ == "__main__":
    main3()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    N = int(input().strip())
    init_array=[]
    stack=[]
    [init_array.append(int(i)) for i in (input().split())]
    for v in init_array:
        if len(stack)==0:
            stack.append(v)
            continue
        else:
            stack.append(v)
            stack.reverse()
    ans_list=[str(num) for num in stack]
    ans=' '.join(ans_list)
    print(ans)


if __name__ == "__main__":
    main()

Fixed submission:
from collections import deque
def main3():
    d = deque()
    rd= deque()
    N = int(input().strip())
    for n in input().split():
        if len(rd)%2!=0:
            d.append(n)
            rd.appendleft(n)
        else:
            rd.append(n)
            d.appendleft(n)
    if N % 2 ==0:
        print(*rd)
    else:
        print(*d)

if __name__ == "__main__":
    main3()