In a Distant Galaxy in the Far Future, old board games are still popular. The humanoid Hyomul is playing "Galactic Timeline".
As is known, in the game "Timeline", there are cards that indicate a year and an event that occurred in that year. The cards must be laid out in sequence so that the order of events is correct: each subsequent event cannot be earlier than the previous one.
In the Distant Galaxy, they save paper, so in "Galactic Timeline", the cards for the game are double-sided — each card has two years and events written on it — one on each side of the cards.
Hyomul has $$$n$$$ cards that he lays out on a glass table. Hyomul noticed that when laying out double-sided cards on the glass table, the timeline is formed from both sides: from the top of the table with the face sides of the cards and from the bottom of the table with the reverse sides.
Initially, all the cards are laid out in arbitrary order from left to right. Hyomul can choose any card on the table and flip it. Hyomul can also choose any two cards on the table and swap them without flipping either of them.
Hyomul became curious whether it is possible to arrange the cards such that the events go in the correct order from left to right on both the top and bottom sides of the table. Help him do this or determine that it is impossible to arrange the cards in the correct order on both sides.
The first line contains the number $$$n$$$ ($$$1 \le n \le 10^5$$$). The second line contains $$$n$$$ numbers $$$a_i$$$ ($$$1 \le a_i \le 10^9$$$) — the years written on the face side of the $$$i$$$-th card. The third line contains $$$n$$$ numbers $$$b_i$$$ ($$$1 \le b_i \le 10^9$$$) — the years written on the reverse side of the $$$i$$$-th card.
Output the information about the cards in the order in which they need to be laid out.
In the first line, output $$$n$$$ years from the face side of the cards, and in the second line—$$$n$$$ years from the reverse side of the cards. If it is impossible to achieve the goal of the game, output $$$-1$$$.
46 8 1 32 4 5 7
1 2 3 4 5 6 7 8
330 10 2010 30 20
-1
In the first example, Hyomul can act, for example, as follows. First, he flips the first card, then he flips the second card. The cards laid out from left to right (with the face and reverse sides indicated by $$$|$$$) are: $$$2|6$$$, $$$4|8$$$, $$$1|5$$$, and $$$3|7$$$. Then Hyomul will swap the first and third cards, the second and third cards, and the third and fourth cards to achieve the correct order on both sides.