## DMOPC '17 Contest 4 P4 - Cops and Robbers

View as PDF

Points: 7 (partial)
Time limit: 1.0s
Memory limit: 256M

Author:
Problem type

In the beautiful capital of Dmojistan, there are banks and a single policeman. The banks are numbered from to . You managed to find the policeman's schedule for the next days. It turns out that on the day, he will be protecting bank .

Armed with this information, you are planning to rob all banks in the next days. You will rob bank on the day. A robbery will be successful if the cop is not protecting that bank on that day (that is, ).

Before you can start robbing, you need to determine a sequence which will work. Output a sequence which will rob all banks or if it is not possible to rob all banks. The sequence should be integers from to .

Any valid sequence will be accepted.

#### Input Specification

The first line will contain .
The next line will contain space-separated integers .

#### Output Specification

Output a valid sequence if it is possible or if it is not. The sequence should be integers from to .

#### Sample Input

5
2 1 1 1 1

#### Sample Output

1 2 3 4 5