A village is being raided by a barbarian, who, despite being on his own, shouldn't be underestimated.
The village consists of houses, numbered from to and arranged in a straight line perpendicular to the shore, with house being meters away from the shore.
The barbarian's strategy is simple: he will raze the house he is in, then move to the closest house that hasn't been razed yet, until all the treasures in the village have been hoarded.
If there is more than one house at the minimum distance, the barbarian will move to the one closest to the shore first.
The villagers have a plan though, which is to hide in the last house that the barbarian will raid to face him when he's most tired.
Trying to predict the barbarian's moves is giving them an headache, moreover, the raid may start from any house.
In order to help them, you have to find, for each possible starting house , which house would be destroyed last by the barbarian.
Input data
The input file consists of:
- a line containing integer .
- a line containing the integers .
Output data
The output file must contain a single line consisting of the integers .
Constraints and clarifications
- .
- for each .
- for each .
- For tests worth points, , , for each .
- For tests worth more points, .
- For tests worth more points, .
Example
stdin
5
1 4 6 7 10
stdout
4 0 4 4 0
Explanation
- When the barbarian starts from house , located meter away from the shore, he destroys it, then moves to house , at a distance of meters from house , then to house , then . The last house standing is number .
- When the barbarian starts from house , located meter away from the shore, he destroys it, then moves to house , at a distance of meters from house , then to house , then . The last house standing is number .
- When the barbarian starts from house , located meter away from the shore, he destroys it, then moves to house , at a distance of meter from house , then to house . Note that both house and are at a distance of meters from house , but house is closer to the shore. He then moves to house . The last house standing is number .
- When the barbarian starts from house , located meter away from the shore, he destroys it, then moves to house , at a distance of meter from house , then to house , then . The last house standing is number .
- When the barbarian starts from house , located meter away from the shore, he destroys it, then moves to house , at a distance of meters from house , then to house , then . The last house standing is number .