LogiQuest

49. Minimum and Maximum

EasyArray

Print the smallest and the largest element of the array, separated by a space.

Input format

Line 1: n Line 2: n integers

Output format

min max

Example 1

Input

5
3 1 4 1 5

Output

1 5

Example 2

Input

1
-7

Output

-7 -7

Constraints

1 ≤ n ≤ 10⁵

Read input from standard input and print the answer to standard output. Your code is judged against 6 test cases, most of them hidden.

Loading the MyLoginn IDE…