Skip to content
UPEEC

Minimum and Maximum

Easy#basics#arrays· solved by 0 · time limit 2.0 s

Print the smallest and the largest of nn integers.

Input

The first line has nn, the second line the nn integers.

Output

Minimum and maximum separated by a space.

Constraints

1≤n≤1051 \le n \le 10^5

Sample 1

Input

4
4 -2 9 0

Output

-2 9

Sign in or join free to run and submit your solution.