#P248. 【例41.3】 最小数和最大数

【例41.3】 最小数和最大数

Description

Input n numbers and find the minimum and maximum values among them.

Input Format

The first line contains an integer n (1≤n≤100), representing the number of values.
The second line contains n integers ai (1≤ai≤10000).

Output Format

Two integers, representing the minimum and maximum values respectively.

Sample

4
3 9 8 1
1 9