10619: 求最大最小值

Memory Limit:128 MB Time Limit:1.000 S
Judge Style:Text Compare Creator:
Submit:5 Solved:0

Description

求n个数中的最大值和最小值。

Input

第1行:一个整数n

第2行:n个整数

Output

一行:两个整数,空格隔开,分别表示所求最大值和最小值。

Sample Input Copy

10
5 6 3 1 9 12 15 4 8 7

Sample Output Copy

15 1