G. Going for Gold
time limit per test
1 second
memory limit per test
512 megabytes
input
standard input
output
standard output

The Triwizard Tournament is a contest between wizarding schools, with each school represented by a champion. At the start of the school year, students enter their names into the Goblet of Fire, which selects one champion for each of the $$$n$$$ participating schools. The school champions then face off in three magical events spread throughout the year.

For this most recent edition, the Triwizard Tournament is using the same scoring system that has been used in the sport climbing event of last year's Tokyo Summer Olympics (this is a sport where muggles compete to see who is able to climb vertical obstacle courses the fastest). After each of the three events, all $$$n$$$ champions are ranked by their scores, each receiving a rank between $$$1$$$ and $$$n$$$, inclusive. In the end, the three ranks of each champion are multiplied and the champion with the lowest score wins the cup for their school.

The first two events have already happened and the third is scheduled for tomorrow. Is it still possible for our favourite, the Hogwarts champion, to win? If yes, find a possible ranking for the third event so that this happens. As Hogwarts won the last edition of the tournament, the rules stipulate that in the event of a tie the Hogwarts champion will be declared the winner.

Input

The input consists of:

  • One line with an integer $$$n$$$ ($$$1 \le n \le 100$$$), the number of champions in the tournament.
  • One line with $$$n$$$ distinct integers $$$a_1,\dots,a_n$$$ ($$$1 \le a_i \le n$$$ for each $$$i$$$), where $$$a_i$$$ is the rank of the $$$i$$$th champion in the first event.
  • One line with $$$n$$$ distinct integers $$$b_1,\dots,b_n$$$ ($$$1 \le b_i \le n$$$ for each $$$i$$$), where $$$b_i$$$ is the rank of the $$$i$$$th champion in the second event.
The Hogwarts champion is the champion with number $$$1$$$.
Output

If there is no way for the Hogwarts champion to win, output impossible. Otherwise, output $$$n$$$ distinct integers $$$c_1,\dots,c_n$$$ ($$$1 \le c_i \le n$$$ for each $$$i$$$), where $$$c_i$$$ is the rank of the $$$i$$$th champion in the third event, so that Hogwarts wins the tournament.

Examples
Input
7
1 6 5 3 2 4 7
7 1 4 2 3 6 5
Output
4 5 3 7 6 2 1
Input
4
2 3 1 4
3 4 1 2
Output
impossible
Input
4
2 1 3 4
2 1 4 3
Output
1 4 2 3