Given an array of integers. Change all its maximum elements to the minimum value, and all its minimum elements to the maximum value.
The first line contains the number n~(n \le 100). The next line contains integers, each of which does not exceed in absolute value.
Print the updated array.
Ejemplo 1