Devu and his friend Amit got selected in a random television reality show. One of the task in the show was really interesting. The task was called "the survival" task. In the task, each person has to vote two person's names. One should not vote a single person twice. Also he/ she should not vote himself/ herself. After the voting, all the person having votes equal to highest and lowest votes are kicked out of the show. Naturally highest voted persons should go out of the show, but to maintain interestingness of the show, they also kick out lowest voted persons too.
Devu and Amit naturally don't want themselves to get kicked out of the show. Fortunately, voting of all other persons than Devu and Amit has already happened, so now Devu and Amit know choices of votes of all other persons. Assume that there are total n persons. You are guaranteed that n is greater than or equal to 3. Devu has index n - 1 and Amit has index n. The votes of all other persons that Devu and Amit are given to you by two arrays firstVote and secondVote each of size n - 2. Now Devu and Amit both want to design a strategy of voting after having discussion with each other. They want that as few of them (i.e. from Devu and Amit) gets out of the show. You have to tell in the best scenario, will both, one or none of them will remain in the show? Print a single line containing "both", "one" or "none" according to the situation. You also have to tell details of whom Devu and Amit will vote? If there are more than possible ways they can vote, print any of them.
First line of the test case will contain a single integer n denoting total number of persons in the show.
Second line contains n - 2 space separated integers denoting the array firstVote, denoting the first votes of all other persons than Devu and Amit.
Third line contains n - 2 space separated integers denoting the array secondVote denoting the second votes of all other persons than Devu and Amit.
For each test case, print three lines.
Second line should contain two space separated integers corresponding to the votes of Devu.
Third line should contain two space separated integers corresponding to the votes of Amit.
Example case 1. There is exactly one way of voting for Devu and Amit. So after the voting, all the persons will have equal votes. So they all will be kicked out of the show. So as Devu and Amit both are kicked out, print "none" in first line. In second line, print votes of Devu(index 2) and in third line print votes of Amit.