As many of you might know, during the golden age of romanian television, one of the most beloved channels was named OTV.
One of the reasons for its popularity were the polls where the spectators voted for one of two options. Maybe the most popular poll was the one asking who would win in a fight between the dacians and the samurai.
After years and years, the OTV founder, DD, is back with his new project: DD Home Cinema. In order to regain his old level of fame he wants to please the nostalgics by bringing back the famous poll, but with a modern twist!
DD gives his spectators two integer sequences (the strenghts of the dacians) and (the strengths of the samurai) and wants another sequence of the same length, where (either the -th dacian or the -th samurai). Because such a large sequence would not fit well on a tv display, he asks for his spectators only for the smallest difference in strength of such a sequence.
Formally, the spectators are asked for the minimum value of among all possible sequences .
Input data
The first line will contain a single integer - the length of the arrays and .
The following lines will each contain 2 integers, , the values that form the sequences and
Output data
The only line will contain a single integer - the minimum value of said expression.
Constraints and clarifications
- For points, it is guaranteed that ;
- For another points, it is guaranteed that ;
- For another points, it is guaranteed that ;
- For the last points, we have .
Example 1
stdin
5
3 4
1 2
6 7
5 1
8 3
stdout
4
Explanation
The minimum value is , and it can be obtain by choosing .