# Change max and min

Easy

Execution time limit is 1 second

Runtime memory usage limit is 128 megabytes

Given an array of $n$ integers. Change all its maximum elements to the minimum value, and all its minimum elements to the maximum value.

## Input

The first line contains the number $n(n≤100)$. The next line contains $n$ integers, each of which does not exceed $100$ in absolute value.

## Output

Print the updated array.

## Examples

Input #1

Answer #1

Submissions 20K

Acceptance rate 51%