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.
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.
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.
515 10 9 10 15
9 45
4100 34 33 10
100 100
26 3
3 6