eolymp
bolt
Try our new interface for solving problems
Problems

Pumpkin porridge

Pumpkin porridge

Time limit 1 second
Memory limit 128 MiB

Grandfather, grandmother, granddaughter and Zhuchka are tired to grow turnip, and they decided to grow a new vegetable - the pumpkin. Its a good plant that creeps along the ground, not buries to the ground, and therefore do not need to pull out from the ground by all together!

Hence, my grandfather planted a pumpkin. A lot of pumkins grew out, but not more than 1000. Grandfather was delighted, he boasted to everyone: to grandmother, to granddaughter and to Zhuchka. They decided to cook pumpkin porridge three times a day, and maybe more. They began to think in what order to eat pumpkin. It was decided that each time for the next porridge the heaviest pumpkin will be chosen. And since for each porridge they require as much millet as pumpkin weigh, Babka urgently needs a schedule, according to which she will have to buy the millet. Your task is to print such a schedule.

prb260

Input data

First given the number of pumpkins n (0n1000) in my grandfather's garden. It is followed by n integers - the weights of each pumpkin in carats. Pumpkins grow big, but the weight of each pumpkin does not exceed 100000 carats.

Output data

Print the weight of each pumpkin in the order in which they fall into the grandmother porridge.

Examples

Input example #1
2 1 2
Output example #1
2 1