You are given an array A of n unique integers. You have to find 2nd maximum and 2nd minimum numbers in this array. If A = [3, 7, -1, 2, 4, 9] 2nd max is 7 2nd min is 2
Input Format
First line contains single integer n Second line contains n space seperated integers A[0], A[1], A[2] .... A[n].
Output Format
print 2nd max then 2nd min is single line
Constraints
1. 2 <= n <= 100
Notice
.
Example
Input
6 3 7 2 -1 4 9
Output
7 2