~/algor $ cat problems/minmax/maximum-of-the-others-for-each
Maximum of the others for each
Medium
1000 ms
128 MB
66%
A positive integer and integers are given. For every (), find the largest of all elements except .
Input
The first line contains a positive integer . The next line contains integers .
Output
One line with integers separated by spaces: the answers for .
Note
Examples
Input #1
5 4 9 2 6 3
Output #1
9 6 9 9 9
Input #2
2 -7 5
Output #2
5 -7