Collections.deque()

  • + 0 comments

    from collections import deque

    N= int(input()) d=deque()

    for _ in range(N): cmd,*args = input().split() getattr(d, cmd)(*map(int, args))

    print(*d)