CPython lite logoProblemsContests

45. Linear Search #4

Given an array consisting of n elements, you need to find the index of the 1st occurrence of 1, the index of the 2nd occurrence of 2, and so on, up to the 9th occurrence of 9. Indexing starts from 1.


Input

The first line contains a natural number, n(1n105).

The second line contains n numbers separated by spaces, ai(1ai109).

Output

Output a single line with the indices. If the searched number does not exist, output 1.


Sample input 1

10
5 1 2 6 3 2 4 3 6 3

Sample output 1

2 6 10 -1 -1 -1 -1 -1 -1

Sample input 2

15
5 2 3 4 5 4 5 3 2 3 4 5 4 5 1

Sample output 2

15 9 10 13 14 -1 -1 -1 -1

Login to be able to submit.

MediumData structuresLoops
185 / 30
Solved / unsolved count
1.5 s / 512 MB
Limits