1806: 【CSP数组】移动数组元素▅

Memory Limit:128 MB Time Limit:1.000 S
Judge Style:Text Compare Creator:
Submit:5 Solved:5

Description

在一个不重复的数组中,请将这个数组的最小数和数组第一个数交换,最大数和数组最后一个数交换。

Input

第一行有一个整数 lns="http://www.w3.org/1998/Math/MathML">n ( lns="http://www.w3.org/1998/Math/MathML">5n100 );

第二行有 lns="http://www.w3.org/1998/Math/MathML">n 个不重复的整数。

Output

移动位置后的数组。

Sample Input Copy

5
6 7 1 10 4

Sample Output Copy

1 7 6 4 10