Processing math: 100%
Extremal - MarisaOJ: Marisa Online Judge

Extremal

Time limit: 1000 ms
Memory limit: 256 MB

Given an integer n and a list A of n integers. Find the maximum and minimum value of A.

Input

  • The first line contains a single integer n.
  • The second line contains n integers Ai.

Output

  • Print the maximum and minimum value of A.

Constraints

  • 1≤n≤1000.
  • |ai|≤1000.

Example

Input:

5
1 0 3 -2 999

Output:

999 -2