Queue using Two Stacks

  • + 0 comments
    p=[]
    for _ in range(int(input())):
        l=list(map(int,input().split()))
        if l[0]==1:
            p.append(l[1])
        if l[0]==2:
            p.pop(0)
        if l[0]==3:
            print(p[0])