que, n = [], int(input().strip())
for _ in range(n):
a = list(map(int, input().strip().split(" ")))
if a[0] == 1:
que.append(a[1])
elif a[0] == 2:
print("ERR_CANNOT_POP") if not que else que.pop(0)
elif a[0] == 3:
print("ERR_CANNOT_QUERY" if not que else que[0])
elif a[0] == 4:
print(len(que))

京公网安备 11010502036488号