PROGRAMMING:Little Z's problem!
FDS class is learning big and small piles recently. Small Z is very enthusiastic about the big and small top pile, but he is not serious in class, so he did not understand what the teacher said in class, confused the insertion of big top pile and small top pile!
Small Z inserts elements into an empty heap. It can only provide the insertion sequence of the heap and the sequence traversal of the heap after insertion. He found GG and wanted to ask GG to help him. GG conjectured the insertion process of small Z and gave a string of binary strings
When a binary character position is' 1 ', the element of the corresponding position will be inserted into the heap according to the rules of the big top heap
When a position of binary character is' 0 ', the element of the corresponding position will be inserted into the heap according to the rule of small top heap
But GG is not sure whether his feeling is right, now GG has left this problem to you, please solve it!
We will give the insertion sequence of the heap, the binary string of GG and the sequence traversal of the heap. Please judge whether the heap inserted according to the binary string given by GG is the heap inserted by small Z (in this problem, if the sequence sequence of two heaps is the same, they can be regarded as the same heap)
Considering that you may not be familiar with heap insertion, here is a description of pseudo code

###Input format:
The first line contains a positive integer n (n < = 1000), which represents the number of elements in the sequence.
The second line contains n integers, representing the initial insertion sequence. The title ensures that all integers are in the range of int.
The third line contains the binary string of GG's conjecture.
The fourth line gives the sequence traversal sequence of the small z-inserted heap.
###Output format:
Judge whether GG's conjecture is correct. If it is correct, please output "ggnb!" on the first line, If not, output "wrong answer!" on the first line
In the second line output according to GG's conjecture after the completion of insertion "heap" traversal( The numbers are separated by spaces, and there are no extra spaces at the end!)
###Input example:
Here is a set of inputs. For example:
```in
five
4 2 3 1 5
ten thousand
1 2 3 4 5
```
###Output example:
The corresponding output is given here. For example:
```out
ggnb!
1 2 4 5 3
```
answer:If there is no answer, please comment
Small Z inserts elements into an empty heap. It can only provide the insertion sequence of the heap and the sequence traversal of the heap after insertion. He found GG and wanted to ask GG to help him. GG conjectured the insertion process of small Z and gave a string of binary strings
When a binary character position is' 1 ', the element of the corresponding position will be inserted into the heap according to the rules of the big top heap
When a position of binary character is' 0 ', the element of the corresponding position will be inserted into the heap according to the rule of small top heap
But GG is not sure whether his feeling is right, now GG has left this problem to you, please solve it!
We will give the insertion sequence of the heap, the binary string of GG and the sequence traversal of the heap. Please judge whether the heap inserted according to the binary string given by GG is the heap inserted by small Z (in this problem, if the sequence sequence of two heaps is the same, they can be regarded as the same heap)
Considering that you may not be familiar with heap insertion, here is a description of pseudo code

###Input format:
The first line contains a positive integer n (n < = 1000), which represents the number of elements in the sequence.
The second line contains n integers, representing the initial insertion sequence. The title ensures that all integers are in the range of int.
The third line contains the binary string of GG's conjecture.
The fourth line gives the sequence traversal sequence of the small z-inserted heap.
###Output format:
Judge whether GG's conjecture is correct. If it is correct, please output "ggnb!" on the first line, If not, output "wrong answer!" on the first line
In the second line output according to GG's conjecture after the completion of insertion "heap" traversal( The numbers are separated by spaces, and there are no extra spaces at the end!)
###Input example:
Here is a set of inputs. For example:
```in
five
4 2 3 1 5
ten thousand
1 2 3 4 5
```
###Output example:
The corresponding output is given here. For example:
```out
ggnb!
1 2 4 5 3
```
answer:If there is no answer, please comment