1337: 模拟队列

Memory Limit:128 MB Time Limit:1.000 S
Judge Style:Text Compare Creator:
Submit:11 Solved:7

Description

实现一个队列,队列初始为空,支持四种操作:

1. push x:向队尾插入一个整数 $x$。
2. pop:弹出对头。
3. size:输出当前队列元素的个数。
4. query:输出队头元素。

现在要对队列进行 $n$ 个操作。

Input

第一行包含整数 $n$,表示操作次数。

接下来 $n$ 行,每行表示一个操作。

Output

若干行。

每一个操作 $3$ 和操作 $4$ 的输出占一行。

Sample Input Copy

6
push 1
query
push 3
pop
push 5
size

Sample Output Copy

1
2

HINT

数据范围

$1 \le n\le 10000,1 \le x \le 10^9$。

Source/Category