The World Coding Federation is setting up a large online programming tournament for teams of two programmers. Judge David puts together the teams of the southeastern delegation. Every student joins exactly one team of two students, and the number of students who want to compete is even, so nobody is left out. David wants every team he sends to the tournament to reach some minimum total rating. The total rating of a team is the sum of the ratings of its two members.
Find the maximum value X such that David can form the teams so that every team has a total rating of at least X.