You are given a sequence of length and a string of length . Each entry of is either or an integer from to , and all entries other than are pairwise distinct. The string contains only < and >.
Find a permutation of length satisfying both conditions below. A permutation of length contains every integer from to exactly once.
If several permutations are possible, find any one of them. If none exists, print .
For example, for and <><, the permutation is valid: its second entry is , and , , and all hold.
The input is given in the following format.
Print one line for each test case.
If no valid permutation exists, print -1. Otherwise, print its entries , separated by spaces. You may print any valid permutation.
The first test case is the example in the statement. In the second, the first entry is already , so no larger second entry can be chosen. In the third, .
The first test case has no permutation satisfying every condition. In the second, the printed permutation respects the fixed entries and all four inequalities.
<, then . Otherwise, ().is the number of test cases. Each test case has the following format.
The first line contains the length . The second line contains the entries of , separated by spaces. The third line contains .
< and >.| 3 | 54 | No additional constraints. |