Gamers' Arrogance

Time limit1sMemory limit128 MB

Problem

A new computer game is about to be released, and gamers are waiting in a line in front of a store until it opens.

While they wait, the gamers talk about recent games, and sometimes the conversation drifts to real-world topics. One unavoidable topic is their computer setups. In particular, the amount of memory on a graphics card can become a source of pride and arrogance.

Because these conversations often become unpleasant, the store decides not to let in gamers it considers too arrogant. To make the decision objective, the store uses the following mathematical model. When a new gamer tries to join the line, compare the memory of that gamer's graphics card with the memory of each graphics card already in the line. For each gamer already in the line, divide the new gamer's memory by that gamer's memory and round the quotient down. The arrogance of the new gamer is the sum of all these rounded quotients.

For instance, suppose the three gamers already in the line have graphics card memories of 3, 1, and 2MB. A new gamer with 3MB has arrogance 1+3+1=5.

The store does not allow a new gamer to join the line if their arrogance is greater than the number of people already in the line. In the situation above, the gamer with 3MB is rejected because their arrogance is 5. A gamer with 2MB is accepted, because their arrogance is 0+2+1=3, which is at most the 3 people already in the line.

Given the arrogances of the gamers in the order they arrived, write a program that finds one possible sequence of graphics card memory amounts.

Input

The first line contains an integer N, the number of gamers in the line. (1 ≤ N ≤ 100 000)

The second line contains N non-negative integers: the arrogances of the gamers in arrival order. For the k-th gamer, counting from 1, the arrogance is always less than k.

Output

Print N integers on one line: the graphics card memory amount of each gamer, in arrival order. Each memory amount must be an integer at least 1 and less than 10^9. The answer may not be unique, but at least one answer always exists.