Given an integer n and a list A of n integers. Find the maximum and minimum value of A.
- The first line contains a single integer n.
- The second line contains n integers Ai.
Output
- Print the maximum and minimum value of A.
Constraints
- 1≤n≤1000.
- |ai|≤1000.
Example
Input:
5
1 0 3 -2 999
Output:
999 -2