Language issues
Your dream has come true — you got into university! But there is one problem: you don't know what language your classes will be in. That's why you signed up for language courses. Today, your teacher came up with a very interesting exercise, but she can't choose the pairs for it, and if you don't help her, she will spend the whole class time trying out all possible combinations.
You are given students who attend the courses with you. The -th student's language proficiency level is . There are also volunteers who can help you. The -th volunteer's language proficiency level is . The pair should consist of a student and a volunteer, and a pair can be formed if the sum of their language proficiency levels is at least . Each person can be in at most one pair. You can invite the first volunteers from the list. Find the minimum value of such that all students have a pair, or output "-1" if it's impossible to form pairs regardless of the chosen .
Input
The first line contains three integers (), (), and () — the number of students, the number of volunteers, and the minimum sum of language proficiency levels in a pair, respectively.
The second line contains integers () — the language proficiency levels of the students.
The third line contains integers () — the language proficiency levels of the volunteers.
Output
Output one integer — the answer to the problem.
Examples
Note
Explanation for the first example:
If we choose , we won't be able to form a second pair.
If we choose , there will be two possible pairs: and . The sum of language proficiency levels in the first pair is , which is less than , so it doesn't fit. The sum of language proficiency levels in the second pair is , which is less than , so it doesn't fit either. Since there is no way to form pairs, we can't choose .
If we choose , one of the possible pairings is . The sum of language proficiency levels in each pair is greater than or equal to , so the answer is .
Scoring
Solutions that correctly solve the task for will be awarded at least 20 points.