#h45. 找最大值‘

找最大值‘

Background

该学数组了。

Description

输入个数组,分别找出最大值和最小值。

Format

Input

第一行输入一个整数n。 第二行输入n各整数表示数组中的数。

Output

输出两个整数分别表示最大值和最小值。

Samples

5
1 2 3 4 5
5 1