Collections.deque()

  • + 0 comments
    from collections import deque
    
    lst = deque([])
    
    for _ in range(int(input())):
        eval('lst.{0}({1})'.format(*input().split() + ['']))
        
    print(*lst)``