Maybe you think this problem is about girls and ladies.
But you're wrong. 'Left dress' means 'Eyes left'. It's used in armed forces. It will make a square more orderly.
Now several soldiers stand in a line. They are in diffient height or the same. When each of them eyes left, the first man he will see is the nearest man higher than him.
For each soldier, you should tell me the height of the first man he will see when his eyes left.
This problem has several cases.
The first line of each case is an integer N (1 < N <= 1 000 000).
Then follows a line with N integers. Indicates the height of each man. (1 <= height <= 1 000 000).
For each case, you should output everyone's first man's position. If one has no first man, then output -1.