The weather station in Shimla recorded the temperature every day for n days.
Find the highest and the lowest temperature.
Input Format
The first line has n.
The second line has n integers, the temperatures.
Output Format
Print the maximum and the minimum separated by a space.
Constraints
• 1 ≤ n ≤ 1000
• -50 ≤ temperature ≤ 50
Examples
Example 1
Input
5
12 -3 8 15 0
Output
15 -3
Explanation Hottest is 15 and coldest is -3.
Example 2
Input
3
-5 -10 -2
Output
-2 -10
Explanation All negative: max is -2, min is -10.
Example 3
Explanation With one day, it is both the hottest and the coldest.
Acceptance
—
Accepted
0
Submissions
0