#### Registered Users Only

Please login to utilize this feature.

Do note that this website only supports submissions in C++.

### exceptionhandling

### Problem Statement

You are given a sequence of length `N`: `A _{1}, A_{2}, ..., A_{N}`.
For each integer

`i`between

`1`and

`N`(inclusive), answer the following question:

- Find the maximum value among the
`N-1`elements other than`A`in the sequence._{i}

### Constraints

`2 ≤ N ≤ 200000``1 ≤ A`_{i}≤ 200000- All values in input are integers.

### Partial Scores

- In the test set worth
`35`points,`N ≦ 2000`.

### Input

Input is given from Standard Input in the following format:

NA_{1}:A_{N}

### Output

Print `N` lines. The `i`-th line (`1 ≤ i ≤ N`) should contain the maximum value among the `N-1` elements other than `A _{i}` in the sequence.

### Sample Input 1

3 1 4 3

### Sample Output 1

4 3 4

- The maximum value among the two elements other than
`A`, that is,_{1}`A`and_{2}= 4`A`, is_{3}= 3`4`. - The maximum value among the two elements other than
`A`, that is,_{2}`A`and_{1}= 1`A`, is_{3}= 3`3`. - The maximum value among the two elements other than
`A`, that is,_{3}`A`and_{1}= 1`A`, is_{2}= 4`4`.

### Sample Input 2

2 5 5

### Sample Output 2

5 5

### Tags

### Subtasks and Limits

Subtask | Score | #TC | Time | Memory | Scoring |
---|---|---|---|---|---|

1 | 35 | 12 | 1s | 256MB | Minimum |

2 | 65 | 34 | 1s | 256MB | Minimum |

3 | 0 | 2 | 1s | 256MB | Minimum |

### Judge Compile Command

g++-7 ans.cpp -o exceptionhandling -Wall -static -O2 -lm -m64 -s -w -std=gnu++17 -fmax-errors=512