Cities of the Nile#351

Cities of the Nile

2 seconds
64 megabytes
Hard

It is known that settlements along the banks of the Nile are very ancient, and many of them have not yet been discovered. An archaeologist decided to analyze the records of ancient merchants and found that they often mention the time required to deliver goods from one settlement to another. Knowing the speed at which boats traveled on the river in those times, the archaeologist was able to convert the travel time into the distance between settlements.

The scientist knew that there were settlements on the Nile during the studied period, and that the location of one settlement—at the mouth of the Nile—was known. He took its location as the starting point. From the analysis of trade records, he obtained exactly \frac{N(N-1)}{2} distances between settlements, i.e., the distances between every pair of settlements.

He needed only to match these distances to settlement pairs and determine the arrangement of the settlements along the Nile. However, he realized that the arrangement reconstructed from these distances might not be unique. Nevertheless, he commissioned a program to output at least one possible arrangement of the settlements.

Input

The first line contains a single integer (3 \leq N \leq 25), the number of settlements.

The next \frac{N(N-1)}{2} lines each contain one positive integer: the distance between a pair of settlements, in increasing order. Each distance does not exceed .

Output

Output the distances from the mouth of the Nile to each of the settlements, in increasing order, one per line. The distance to the first settlement is always .

Examples

Example 1

Loading
Loading