This page is still under construction.

Parts of this page are still being built. What you see may change.

Questionnaire

Time limit1sMemory limit512 MB

Summary
Given n distinct positive integers, find a modulus m and residue k so that at least half the numbers are congruent to k mod m.
Level

Hard8 of 10

Topics
Math, Number theory, Probability, Brute force
Solved
No attempts yet

Problem

To get better results in official ACM ICPC contests, the team leader came up with a questionnaire. He asked every participant whether they want to have more training.

Many people did not want more training, so the clever leader did not write down their words such as "Yes" or "No". Instead, he let everyone choose a positive integer aia_i to represent their opinion. Amazingly, all the resulting numbers were distinct.

Now the leader wants to choose a pair of positive integers mm (1<m≤1091 < m \le 10^9) and kk (0≤k<m0 \le k < m), and regard those people whose number is exactly kk modulo mm as "Yes", and all others as "No". If there are at least as many "Yes" answers as "No" answers, the leader can have a chance to offer more training.

Please help the team leader find such a pair of mm and kk.

Input

The first line of the input contains an integer nn: the number of ACM ICPC participants (3≤n≤1053 \leq n \leq 10^5).

The next line contains nn distinct integers a1a_1, a2a_2, …\ldots, ana_n: the numbers chosen by the participants (1≤ai≤1091 \leq a_i \leq 10^9).

Output

Print a single line containing two integers mm and kk. If there are several possible solutions, print any one of them.

Examples1

  1. Example 1

    Input
    6
    23 3 18 8 13 9
    
    Expected output
    5 3