PROGRAMMING:Stack emulation queue
Suppose there are two stacks S1 and S2, please simulate a queue Q with these two stacks.
To simulate a queue with a stack is to call the following operation functions of the stack:
-'int isfull (stack ` s): judge whether the stack ` s' is full, and return 1 or 0;
-` int isempty (stack ` s): judge whether the stack ` s' is empty, and return 1 or 0;
-'void push (stack s, ElementType item)';
-'ElementType pop (stack) ` s: delete and return the top of stack element of's'.
Implement the queue operation, that is, queue in 'void addq (ElementType item)' and queue out 'ElementType deleteq().
###Input format:
Input first gives two positive integers' N1 'and' N2 ', indicating the maximum capacity of' S1 'and' S2 'in the stack. Then, a series of queue operations are given: "a item" means to put "item" into the column (assume here that "item" is an integer number)` D 'denotes team out operation` T 'indicates the end of input.
###Output format:
For each'd 'operation in the input, output the corresponding number of outgoing, or the error message' error: empty '. If the queue operation cannot be performed, you need to output 'error: full'. Each output occupies one line.
###Input example:
```in
3 2
A 1 A 2 A 3 A 4 A 5 D A 6 D A 7 D A 8 D D D D T
```
###Output example:
```out
ERROR:Full
one
ERROR:Full
two
three
four
seven
eight
ERROR:Empty
```
answer:If there is no answer, please comment
To simulate a queue with a stack is to call the following operation functions of the stack:
-'int isfull (stack ` s): judge whether the stack ` s' is full, and return 1 or 0;
-` int isempty (stack ` s): judge whether the stack ` s' is empty, and return 1 or 0;
-'void push (stack s, ElementType item)';
-'ElementType pop (stack) ` s: delete and return the top of stack element of's'.
Implement the queue operation, that is, queue in 'void addq (ElementType item)' and queue out 'ElementType deleteq().
###Input format:
Input first gives two positive integers' N1 'and' N2 ', indicating the maximum capacity of' S1 'and' S2 'in the stack. Then, a series of queue operations are given: "a item" means to put "item" into the column (assume here that "item" is an integer number)` D 'denotes team out operation` T 'indicates the end of input.
###Output format:
For each'd 'operation in the input, output the corresponding number of outgoing, or the error message' error: empty '. If the queue operation cannot be performed, you need to output 'error: full'. Each output occupies one line.
###Input example:
```in
3 2
A 1 A 2 A 3 A 4 A 5 D A 6 D A 7 D A 8 D D D D T
```
###Output example:
```out
ERROR:Full
one
ERROR:Full
two
three
four
seven
eight
ERROR:Empty
```
answer:If there is no answer, please comment