#D11382. Queue
Queue
Queue
Queue is a container of elements that are inserted and deleted according to FIFO (First In First Out).
For queues (), perform a sequence of the following operations.
- enqueue(, ): Insert an integer to .
- front(): Report the value which should be deleted next from . If is empty, do nothing.
- dequeue(): Delete an element from . If is empty, do nothing.
In the initial state, all queues are empty.
Constraints
Input
The input is given in the following format.
:
Each query is given by
0
or
1
or
2
where the first digits 0, 1 and 2 represent enqueue, front and dequeue operations respectively.
Output
For each front operation, print an integer in a line.
Example
Input
3 9 0 0 1 0 0 2 0 0 3 0 2 4 0 2 5 1 0 1 2 2 0 1 0
Output
1 4 2
inputFormat
Input
The input is given in the following format.
:
Each query is given by
0
or
1
or
2
where the first digits 0, 1 and 2 represent enqueue, front and dequeue operations respectively.
outputFormat
Output
For each front operation, print an integer in a line.
Example
Input
3 9 0 0 1 0 0 2 0 0 3 0 2 4 0 2 5 1 0 1 2 2 0 1 0
Output
1 4 2
样例
3 9
0 0 1
0 0 2
0 0 3
0 2 4
0 2 5
1 0
1 2
2 0
1 0
1
4
2
</p>