MCPT has decided to give shoes to all of its execs. They have pairs of shoes, the shoe with size , which they plan to give to the execs and the dictator, Larry.
Each exec has a shoe size . When an exec with shoe size wears a shoe of size , their comfort is .
Since Larry is a dictator, he gets the first choice for his pair of shoes. Once Larry has chosen a pair of shoes, he wants to distribute the rest of the shoes among the execs such that the maximum comfort over execs is minimal (because he's a dictator).
Larry is indecisive however, and doesn't know which pair of shoes he wants to pick. Thus, he wants to know the minimum maximum comfort across all execs if he chooses the shoe for .
Input Specification
The first line will contain one integer
The next line will contain integers .
The last line will contain integers .
Output Specification
On one line, you are to output integers, the integer being the minimum maximum comfort if Larry chooses the shoe.
Subtasks
Subtask 1 (2%)
Subtask 2 (9%)
Subtask 3 (89%)
No additional constraints.
Sample Input
3
4 3 7 6
2 6 4
Sample Output
2 2 1 1
Comments