#include <iostream>
#include <algorithm>
#include <cstring>
#include <vector>
#include <cmath>

using namespace std;

#define MAX 15
#define INF 1e9

struct Pair{
  int n;
  double d,b;
  Pair() {}
  Pair(int n,double d,double b) : n(n), d(d), b(b) {}
};

int N;
double dp[MAX][1<<MAX][MAX],mt;
vector<int> path,p;
vector<Pair> vec;

double V(double w){
  return 2000. / (70. + w);
}

double dist(int a,int b){
  return abs(vec[a].d-vec[b].d);
}

double solve(int cur,int S,int prev,double t,double b){
  if(cur == N){
    if(mt > t){
      mt = t;
      path = p;
    }
    return t;
  }
  if(prev >= 0 && dp[cur][S][prev] >= 0) return dp[cur][S][prev];

  double res = INF;
  for(int i = 0 ; i < N ; i++){
    if(S >> i & 1) continue;
    double d,nt;
    if(cur == 0){
      d = vec[i].d;
    }else{
      d = dist(prev,i);
    }
    nt = d / V(b*20);
    p.push_back(vec[i].n);
    res = min(res,solve(cur+1,S|1<<i, i, t+nt, b+vec[i].b));    
    p.pop_back();
  }
  if(prev == -1) return res;
  return dp[cur][S][prev] = res;
}

int main(){
  cin >> N;
  vec.resize(N);
  for(int i = 0 ; i < N ; i++){
    cin >> vec[i].n >> vec[i].d >> vec[i].b;
  }
  memset(dp,-1,sizeof(dp)); mt = INF;
  solve(0,0,-1,0,0);
  int size = path.size();
  for(int i = 0 ; i < size ; i++){
    if(i == 0){
      cout << path[i];  
    }else{
      cout << " " << path[i];
    }
  }
  cout << endl;

  return 0;
}