Олимпиадный тренинг

Задача 34880. Lot of Krizhanovsky


Petya plays with his friends a game sometimes called "Krizhanovsky's Lot". The rules of the game are as follows: in each round, each player guesses an arbitrary natural number. After that, the player who guessed the minimum number that does not repeat wins this round, and his payoff is equal to this number. For example, if 6 people play and the numbers 3, 2, 1, 1, 4 and 2 were guessed, then the first player won, and his payoff is 3. If all the guessed numbers are repeated, then the round is considered a draw and no one gets points.< br />
The total winnings of the player for the game is equal to the sum of points for all rounds played.

During the game, Petya and his friends simply call the numbers they have guessed in turn, and then determine who won and calculate the points. However, with this format of the game, in principle, you can cheat without guessing the number in advance, but, already knowing the numbers named by the previous players, choose the optimal “guessed” one for yourself. number. This is what Petya uses. He calls the last number and tries to choose the number in such a way as to maximize his winnings.

The last round of the game is underway. The points of all players before this round and the numbers named by the players are known. Find out what number should be called to Petya so that, according to the results of the game, as many players as possible have a score less than his. If there are several such numbers, then Petya wants to name the minimum possible number.

Input
The first line contains the number n - the number of players (2 <= n <= 100). The second line contains n numbers - the scores of the players before the last round (non-negative integers not greater than 100). The scores are listed in the order in which the players usually name the numbers (i.e. Petya's scores are listed last). The third line contains (n-1) number - the numbers named by the players in the last round (the numbers do not exceed 100), in the order in which they named them.

Imprint
Print a number to name Petya.

Explanations
In the second sample Petya cannot win in the last round. However, by naming the number 2, Petya does not allow the first player to win, and, thus, remains the second according to the results of the whole game. Four players have less points than Petya.
 
Input Output
6
0 0 0 0 0 0
2 3 4 5 6
1
6
8 3 12 5 0 9
2 1 3 1 4
2