Олимпиадный тренинг

Задача 38254. Cork


One summer day, Arkady and his parents went on a road trip. He really hoped that outside the city they would be able to avoid the hated traffic jams. But, alas, after an hour they got into a traffic jam. Arkady felt sad and thought about how fast they could go if there were no traffic jams ... The section of the road they are on now, — single-lane. And this means that it is not possible to overtake the cars in front. That is, no matter how powerful the car is, it still cannot go faster than the car in front of it. Arkady is well versed in cars and therefore knows the maximum speeds of those cars that are ahead. Now he wants to figure out what the maximum speed each car could be in this area would be.

Input
The first line contains the number N (1 ≤ N ≤ 200) — the number of cars in traffic. The next N lines contain one integer each, and the i-th line contains the speed of the i-th car. The speed of each of the cars does not exceed 300. It is assumed that the (i + 1)-th car goes behind the i-th car, and the first car can go at its maximum speed.

Imprint
Print N numbers — the speed of cars with which they could drive on this section.
Examples
# Input Output
1 2
80
100
80 80