Given array of n integers. Change all its maximum elements to minimum, and all its minimum elements change to maximum.
First line contains number n (n ≤ 100). Next line contains n integers, each of them does not exceed 100 by absolute value.
Print the updated array.