Collections.deque()

  • + 0 comments

    from collections import deque

    d=deque([]) n=int(input()) for _ in range(n): method,*args=input().split() if args: getattr(d,method)(*map(int,args)) else: getattr(d,method)() print(*d)