You want to choose three persons from $N$ candidates to form a team.
Each candidate has five parameters: power, speed, technique, knowledge, and inventiveness.
The power, speed, technique, knowledge, and the inventiveness of the $i$\-th candidate are $A_i$, $B_i$, $C_i$, $D_i$, and $E_i$, respectively.
Let us define your team's power as the maximum of the members' powers. The team's speed, technique, knowledge, and inventiveness are defined similarly.
Then, let us define your team's total strength as the minimum of the team's power, speed, technique, knowledge, and inventiveness.
Find the maximum possible value of your team's total strength.
## Constraints
* All values in input are integers.
* $3 ≤ N ≤ 3000$
* $1 ≤ A_i, B_i, C_i, D_i, E_i ≤ 10^9$
## Input
Input is given from Standard Input in the following format:
$N$
$A_1$ $B_1$ $C_1$ $D_1$ $E_1$
$A_2$ $B_2$ $C_2$ $D_2$ $E_2$
$\vdots$
$A_N$ $B_N$ $C_N$ $D_N$ $E_N$
[samples]