#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:640000000")
using namespace std;
const double eps = 1e-9;
const double pi = acos(-1.0);
long long v[4444], d[4444], p[4444];
int main() {
  int n;
  cin >> n;
  vector<int> q;
  for (int i = 0; i < n; i++) {
    cin >> v[i] >> d[i] >> p[i];
    q.push_back(i);
  }
  vector<int> res;
  while ((int)(q).size() > 0) {
    int cur = q[0];
    res.push_back(cur);
    vector<int> nxt;
    long long val = v[cur];
    long long sub = 0;
    for (int i = 1; i < (int)(q).size(); i++) {
      int id = q[i];
      p[id] -= sub + val;
      if (p[id] < 0) {
        sub += d[id];
      } else {
        nxt.push_back(id);
      }
      val--;
      if (val < 0) val = 0;
    }
    q = nxt;
  }
  cout << (int)(res).size() << endl;
  for (int i = 0; i < (int)(res).size(); i++) {
    cout << res[i] + 1 << " ";
  }
  return 0;
}
