Lupin III
Lupin III, a famous thief, hears from a beautiful woman named Fujimineko, who is a descendant of an Aizu clan samurai, that the Aizu clan left behind military funds in Aizu-Wakamatsu City. According to the report of Ishikawa Goemon, Lupin's long-time companion, the military funds are stored in several warehouses in wooden boxes. The warehouses are not guarded, but they are locked securely. However, if Goemon uses the secret technique "Steel Cutting" that he learned from his father, he can break open the warehouses in an instant.
The remaining problem is the transportation of the wooden boxes. Lupin and Goemon, who lack physical strength, cannot carry even one wooden box. Therefore, they rely on a dependable man named Mugen Daisuke for transportation.
To transport all the wooden boxes, Lupin devises the following plan:
First, Lupin will drive to the first warehouse and drop off Goemon and Daisuke.
Goemon breaks open the warehouse.
Daisuke carries all the wooden boxes.
Lupin heads to the next warehouse with the wooden boxes.
This is repeated until all the warehouses are broken open and the wooden boxes are transported. During this time, Lupin prepares a helicopter and carries Goemon, Daisuke, and the wooden boxes to the last warehouse, then escapes. Daisuke can carry anything, no matter how heavy, but his speed decreases depending on the weight of the luggage. Lupin must determine the order in which to break open the warehouses, taking this into account.
On behalf of Lupin, write a program that outputs the order in which to break open the warehouses so that the time from breaking open the first warehouse to reaching the last warehouse is minimized. However,
The warehouses all face a street that runs straight north from Tsuruga Castle. There are at most 15 warehouses, and they are all within 10,000 meters of the castle.
Each wooden box weighs 20 kilograms. There are at most 10,000 wooden boxes stored in each warehouse.
Transportation from warehouse to warehouse is done through an underground passage that runs along the street.
Daisuke moves at a rate of 2,000 / (70 + w) meters per minute when carrying a load of w kilograms.
For each warehouse, the input consists of the warehouse number (an integer up to 100), the distance from the castle in meters (an integer between 1 and 10,000), and the number of wooden boxes stored in the warehouse (an integer between 1 and 10,000).
Input
The input is given in the following format.
n
s1 d1 v1
s2 d2 v2
:
sn dn vn
The first line contains the number of warehouses, n (n ≤ 15), and the following n lines describe the warehouses. Each line gives the warehouse number si (1 ≤ si ≤ 100), the distance from the castle di (1 ≤ di ≤ 10,000), and the number of wooden boxes stored in the warehouse vi (1 ≤ vi ≤ 10,000).
Output
Output the order in which to break open the warehouses on a single line, separated by spaces.
Sample Input 1
2
1 100 1
2 200 2
Output for the Sample Input 1
1 2
Sample Input 2
3
11 100 1
13 200 20
12 300 3
Output for the Sample Input 2
11 12 13
Sample Input 3
5
13 199 1
51 1000 1
37 350 10
27 300 2
99 200 1000
Output for the Sample Input 3
51 37 27 13 99
