Problem1012--求最大最小值

1012: 求最大最小值

[Creator : ]
Time Limit : 1.000 sec  Memory Limit : 128 MiB

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

Source/Category