Excellence#8185

Excellence

1 second
128 megabytes
Very easy

The World Coding Federation is organizing a large online programming tournament with teams consisting of pairs of programmers. Judge David is responsible for forming teams from the Southeastern delegation. Every student must be placed on exactly one team of two students. Fortunately, he has an even number of students wishing to compete, so each student can participate. However, David would like to maintain his excellent reputation among the other judges by ensuring that each team he fields meets a minimum total rating. The total rating of a team is defined as the sum of the ratings of both members of the team.

Help David determine the maximum value such that he can form teams where every team's total rating is greater than or equal to .

\InputFileThe first line contains a single positive integer (1 \leq n \leq 10^5, is even), the number of students wishing to enter the online programming tournament. Each of the following lines contains one integer s_i (1 \leq s_i \leq 10^6), the rating of the -th student.

\OutputFilePrint the maximum value such that David can form teams so that every team has a total rating greater than or equal to .

Examples

Example 1

Loading
Loading