In the third semester of the first grade of JOI High School, N courses are given for M weeks from the first week to the M-th week. The courses are numbered from 1 to N. In each week, N classes are given. The i-th class in each week is a class for Course i.
Bitaro is a student of the first grade. In each of the N×M classes, he takes one of the following actions.
In the beginning, the comprehension level of every course is 0. Since Bitaro wants to practice competitive programming after school, he will not study outside the duration of the classes. When all the classes in the third semester finish, the final examination will be held.
Bitaro does not want to get a failing grade. Therefore, he wants to maximize the minimum comprehension level of the courses at the moment of the final examination.
Given the length of the semester, the number of the courses, and the incremental values of the comprehension levels, write a program which calculates the maximum possible value of the minimum comprehension level of the courses at the moment of the final examination.
Read the following data from the standard input. Given values are all integers.
\begin{align\*} & N\\,M \\\ & A\_1 \\, A\_2 \\, \cdots \\, A\_N \\\ & B\_1 \\, B\_2 \\, \cdots \\, B\_N\end{align\*}
Write one line to the standard output. The output should contain the maximum possible value of the minimum comprehension level of the courses at the moment of the final examination.