#include <bits/stdc++.h>
using namespace std;
typedef pair<double, double> P;
typedef pair<P, int> P2;

#define INF 100000000

int n;
double s[55] = {0}, v[55] = {0}, d[55] = {0};
P2 dp[1 << 16][16];
vector<int>e;

void dfs(int now, int nowb){
	e.push_back(s[now]);
	if(dp[nowb][now].second == -1) return;
	dfs(dp[nowb][now].second, nowb & ~(1 << now));
}

int main(){
	cin >> n;
	for(int i = 0; i < n; i++) cin >> s[i] >> d[i] >> v[i];
	for(int i = 0; i < (1 << n); i++){
		for(int j = 0; j < n; j++){
			dp[i][j].first.second = INF;
		}
	}
	for(int i = 0; i < (1 << n); i++){
		for(int j = 0; j < n; j++){
			if(i == 0){
				dp[(1 << j) | i][j].first.first = v[j]*20.0;
				dp[(1 << j) | i][j].first.second = 0;
				dp[(1 << j) | i][j].second = -1;
 			}
			else{
				if(i & (1 << j)) continue;
				for(int k = 0; k < n; k++){
					if(!(i & (1 << k))) continue;
					int pv = dp[i][k].first.first;
					int pd = dp[i][k].first.second;
					if((2000.0 / (70.0 + pv)) <= 0) continue;
					if(dp[i | (1 << j)][j].first.second > pd + (abs(d[j] - d[k]) / (2000.0 / (70.0 + pv)))){
						dp[i | (1 << j)][j].first.first = pv + v[j]*20.0;
						dp[i | (1 << j)][j].first.second = pd + (abs(d[j] - d[k]) / (2000.0 / (70.0 + pv)));
						dp[(1 << j) | i][j].second = k;
					}
				}
			}
		}
	}
	int st = -1;
	int ma = INF;
	for(int i = 0; i < n; i++){
		if(ma > dp[(1 << n) - 1][i].first.second){
			ma = dp[(1 << n) - 1][i].first.second;
			//cout << ma << endl;
			st = i;
		}
		//out << dp[(1 << n) - 1][i].first.second << endl;
	}
	dfs(st, (1 << n)-1);
	//cout << endl;
	for(int i = n-1; i >= 0; i--){
		if(i == 0) cout << e[i] << endl;
		else cout << e[i] << " ";
	}
	return 0;
}

