Time Limit: 1 Sec Memory Limit: 128 MB
Giving a queue and 2 kinds of operations: "E x
" means add x to the rear of the queue, "D x
" means pop the front x
elements of the queue.
The first line contains an integer E x
or D x
. We guarantee operation D
does not empty the queue.
Output the front element in queue in a single line for each "D
" operation
6
E 1
E 2
E 3
D 2
E 1
D 1
3
1