You are given NNN integers. Write a program that finds the smallest and the largest of them.
The first line contains the number of integers NNN (1≤N≤1061 \le N \le 10^61≤N≤106).
The second line contains the NNN integers, separated by spaces. Each integer is at least −106-10^6−106 and at most 10610^6106.
Print the smallest and the largest of the NNN given integers on the first line, separated by a single space.