Lightning Conductor

No attempts yetTime limit1sMemory limit128 MB

Problem

Worsening climate change has forced the city of Byteburg to build one large lightning conductor that protects every building in the city. The buildings stand in a single row along one street and are numbered from 11 to nn.

The heights of the buildings and of the lightning conductor are non-negative integers. The budget allows only a single lightning conductor to be built, and, as you would expect, the taller it is, the more it costs.

A lightning conductor of height pp placed on the roof of building ii (whose height is hih_i) protects building jj (whose height is hjh_j) exactly when

hjhi+pijh_j \le h_i + p - \sqrt{|i - j|}

where ij|i - j| is the absolute difference of the two building numbers.

For every building ii, determine the smallest height of a lightning conductor that, placed on top of building ii, would protect all of the buildings.

Input

The first line contains a single integer nn (1n500,0001 \le n \le 500{,}000), the number of buildings.

Each of the next nn lines contains a single integer hih_i (0hi1,000,0000 \le h_i \le 1{,}000{,}000), the height of the ii-th building.

Output

Print exactly nn lines. The ii-th line must contain one non-negative integer pip_i: the minimum height of a lightning conductor placed on the ii-th building that protects every building.