#include <bits/stdc++.h>
using namespace std;
int v[4100], d[4100], p[4100], a[4100], b[4100];
vector<int> vt;
int cnt[4100];
int solve(int k) {
  for (int i = 0; i <= k; ++i) cnt[i] = 0;
  cnt[min(v[a[0]], 4000) + 1]++;
  long long tot = v[a[0]];
  int lef = 1;
  int num = 0;
  for (int i = 1; i < k; ++i) {
    lef -= cnt[i];
    int ii = a[i];
    if (p[ii] < tot) {
      tot += d[ii];
    } else {
      p[ii] -= tot;
      b[num++] = ii;
    }
    tot -= lef;
  }
  for (int i = 0; i < num; ++i) a[i] = b[i];
  return num;
}
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> v[i] >> d[i] >> p[i];
    a[i] = i;
  }
  while (n > 0) {
    vt.push_back(a[0] + 1);
    n = solve(n);
  }
  cout << vt.size() << endl;
  for (int i = 0; i + 1 < vt.size(); ++i) printf("%d ", vt[i]);
  if (vt.size() > 0) cout << vt.back() << endl;
  return 0;
}
