#include <bits/stdc++.h>
using namespace std;
struct child {
  int v, d, p;
};
int main() {
  int n;
  scanf("%d", &n);
  child a[n + 1];
  for (int i = 1; i <= n; ++i) {
    cin >> a[i].v >> a[i].d >> a[i].p;
  }
  vector<int> res;
  for (int i = 1; i <= n; ++i) {
    if (a[i].p < 0) continue;
    res.push_back(i);
    int vol = a[i].v, j = i + 1;
    vector<int> run;
    while (vol > 0 && j <= n) {
      if (a[j].p >= 0) {
        a[j].p -= vol;
        if (a[j].p < 0) run.push_back(j);
        vol--;
      }
      j++;
    }
    while (run.size() != 0) {
      vector<int> temp = run;
      run.clear();
      for (j = 0; j < temp.size(); j++) {
        int k = temp[j];
        k++;
        while (k <= n) {
          if (a[k].p >= 0) {
            a[k].p -= a[temp[j]].d;
            if (a[k].p < 0) run.push_back(k);
          }
          k++;
        }
      }
    }
  }
  cout << res.size() << endl;
  for (int i = 0; i <= res.size() - 1; ++i) cout << res[i] << " ";
  cout << endl;
  return 0;
}
