PROGRAMMING:Implementation and basic operation of queue
Given an initially empty queue and a series of queue in and out operations, please write a program to output the elements of each queue out. The element values of the queue are all integers.
###Input format:
Enter a positive integer n in the first line to indicate the number of operations; Next, there are n lines, each of which represents an operation in the format of 1D or 0. 1 D means to put integer d into the team, 0 means to leave the team. N not more than 20000.
###Output format:
Output the elements out of the team in order, one line for each element. If an outbound operation is illegal (such as outbound when the queue is empty), invalid will be output for the operation.
###Input example:
Here is a set of inputs. For example:
```in
seven
1 1
1 2
0
0
0
1 3
0
```
###Output example:
The corresponding output is given here. For example:
```out
one
two
invalid
three
```
answer:If there is no answer, please comment
###Input format:
Enter a positive integer n in the first line to indicate the number of operations; Next, there are n lines, each of which represents an operation in the format of 1D or 0. 1 D means to put integer d into the team, 0 means to leave the team. N not more than 20000.
###Output format:
Output the elements out of the team in order, one line for each element. If an outbound operation is illegal (such as outbound when the queue is empty), invalid will be output for the operation.
###Input example:
Here is a set of inputs. For example:
```in
seven
1 1
1 2
0
0
0
1 3
0
```
###Output example:
The corresponding output is given here. For example:
```out
one
two
invalid
three
```
answer:If there is no answer, please comment