Marriage#11053

Marriage

1 second
128 megabytes
Hard

While investigating the machines in the gambling hall, Ralph found what seems to be the most boring game ever made. It bears the proud name "Let's dance." The goal of the game is to match up the best dance pairs from the given boys and girls.

There are boys in the game, numbered for convenience from to , and girls, also numbered from to . All children are located along the coordinate line, and -th boy is located at the point with coordinate b_i, and the -th girl is located at the point with coordinate g_j. The game is made not very realistic, so it may be that several children are located at the same point.

Of course, children have their own preferences, which, however, are arranged quite simply: let's call the sympathy between the -th boy and -th girl the reciprocal of the distance between them on a straight line, which in turn is calculated by the formula |b_i - g_j|. In other words, the closer the boy and girl are, the more they like each other. Please note that several girls can be equally attractive to one boy at once, and vice versa.

The player must make pairs, each of which must contain one boy and one girl, and each child must be present exactly once in one of the pairs.

However, not any pairing will do. Let boy be paired with girl , and boy be paired with girl . We will say that between the boy and the girl , there is a temptation if the sympathy between and is strictly greater than the sympathy between and , and also the sympathy between and . In other words, temptation arises between a boy and a girl if the sympathy between them is greater than the sympathy within their couples.

The goal of the game is to divide all the boys and girls into pairs so that there are no temptations during this division. The game turned out to be surprisingly addictive, but Ralph can't cope with its next level. So he asked you to write a program that either wins this game or determines that it can't be done.

Input

The first line contains a single integer (1 \leq n \leq 10^5) - the number of boys and girls. The second line contains integers b_i (1 \leq b_i \leq 10^9) - the coordinates of the boys on the line. The third line contains integers g_i (1 \leq g_i \leq 10^9) - the coordinates of the girls on the line.

Output

If it is impossible to pair the children so that there are no temptations, write a number . Otherwise, print lines indicating a suitable pairing. Each line must contain two integers from to - the number of the boy and girl in the next pair, respectively.

If there are several suitable pairings, print any of them.