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.
The first line contains the integer n. The next line contains n integers, each whose absolute value does not exceed 100.
Print the modified array.
Example 1