We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
from collections import deque
d = deque()
for _ in range(int(input())):
inp = input().split()
getattr(d, inp[0])(*[inp[1]] if len(inp) > 1 else [])
print(*[item for item in d])
Collections.deque()
You are viewing a single comment's thread. Return to all comments →
6 lines: