Last Largest#219

Last Largest

1 second
128 megabytes
Very easy (≈850)

An array consisting of n integers is given. Find the largest element encountered in the array at the last instance and swap it with the last element. Keep the other elements unchanged.

Input

The first line contains the integer n. The next line contains n integers, each whose absolute value does not exceed 100.

Output

Print the modified array.

Examples

Example 1

Loading
Loading