Random Numbers

아직 제출이 없습니다시간 제한5초메모리 제한512 MB

문제

Yuuka has nn integers a_1,a_2,,a_na\_1, a\_2, \dots, a\_n generated uniformly and independently between 11 and 101810^{18}, inclusive.

Yuuka chooses an integer mm. Next, an integer kk is generated uniformly between 00 and (m1)(m - 1), inclusive. After that, Yuuka changes every a_ia\_i to (a_i+k)modm(a\_i + k) \bmod m. Finally, she randomly shuffles the integers. The resulting integers are b_1,b_2,,b_nb\_1, b\_2, \ldots, b\_n.

Now, given a_1,a_2,,a_na\_1, a\_2, \ldots, a\_n and b_1,b_2,,b_nb\_1, b\_2, \ldots, b\_n, you need to figure out the values of mm and kk.

입력

The first line contains an integer nn, the number of integers (105n210510^5 \le n \le 2 \cdot 10^5).

The second line contains nn integers a_1,a_2,,a_na\_1, a\_2, \dots, a\_n: the nn randomly generated integers (1a_i10181 \le a\_i \le 10^{18}).

The third line contains nn integers b_1,b_2,,b_nb\_1, b\_2, \dots, b\_n: the resulting integers (0b_i<10100 \le b\_i < 10^{10}).

It is guaranteed that there exists a solution such that 0k<m10100 \le k < m \le 10^{10}.

출력

Output two integers mm and kk on a single line. If there are several possible answers, output any one of them.

힌트

Please note that the example in the problem statement is only to show the format! The tests in the system will not include this example (test 1 will be some other test), as it violates the constraints.