Rank Order

No attempts yetTime limit3sMemory limit256 MB

Problem

A competition director supervises a panel of judges. Each judge gives every competitor an integer score, and a higher score is a better score. The competition publishes standards for what the score values mean, but judges read those standards differently, so a score of 100 can mean one thing to one judge and something else to another.

The director wants to know which competitors should receive the prizes for the top places. Absolute scores differ from judge to judge, but relative rankings carry the information the director needs. If two judges put the same competitors in first place, second place, third place, and so on, they agree on who should receive the prizes.

Write a program that compares the scores of a pair of judges. Read two lists of integer scores given in competitor order and report the highest ranking place at which the two judges disagree. First place is the highest place.

Input

The input is a series of score list pairs. Each pair begins with a single integer NN, the number of competitors, where 1<N<10000001 < N < 1000000. The next NN integers are the first judge's scores in competitor order. The NN integers after those are the second judge's scores, also in competitor order. Every score is between 00 and 100000000100000000 inclusive. Judges may not give ties, so the scores of a single judge are all different. Values are separated by one or more spaces or newlines. End of file follows the last score list pair.

Output

Print one line for each score list pair. The line holds the integer for the highest ranking place at which the two judges do not agree. If the judges agree on every place, the line holds only the word agree. The line format is Case, one space, the case number, a colon, one space, then the answer for that case, with no trailing spaces. Case numbers start at 1.