Collections.deque()

  • + 0 comments

    from collections import deque n = int(input()) d = deque() for i in range(n): command,*args = input().split() if args: getattr(d,command)(int(args[0])) else: getattr(d,command)() print(' '.join(map(str,d)))