J. Acarajé
time limit per test
3 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output

Moretev is a Kazakh born in Astana who moved to Salvador and fell in love with Acarajé, a major highlight of Brazilian cuisine. Because of this, he decided to start his own Acarajé stand. However, upon starting his sales, he faced a significant problem: he is required to set the price of the product before advertising it.

"How absurd! In the bazaars of my hometown, this doesn't happen!"

You have been hired to help Moretev set the price of his Acarajé in order to maximize his profits. To assist him, he conducted a survey and provided the following sample: a list of $$$N$$$ consumers, where consumer $$$i$$$ will only buy the Acarajé if the price is less than or equal to $$$p_i$$$.

Based solely on this list, determine the price that Moretev should set for his Acarajé and what his revenue would be in this sample.

Input

The first line contains an integer $$$N$$$ ($$$1 \leq N \leq 10^6$$$), the number of consumers on the list. The second line contains $$$N$$$ integers $$$p_i$$$ ($$$1 \leq p_i \leq 10^9$$$), representing the list according to the description.

Output

Print a line containing two integers $$$P$$$ and $$$R$$$, where $$$P$$$ is the price that Moretev should set for his Acarajé and $$$R$$$ is the revenue that would be obtained. If there is more than one price that maximizes the revenue, print any one of them.

Examples
Input
5
15 10 9 10 15
Output
9 45
Input
4
100 34 33 10
Output
100 100
Input
2
6 3
Output
3 6