#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  long long p[4004], v[4004], d[4004];
  long long num = 0, ans[4004];
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> v[i] >> d[i] >> p[i];
  }
  long long vol;
  long long ds;
  for (int i = 0; i < n; i++) {
    vol = v[i];
    ds = 0;
    if (p[i] < 0) continue;
    ans[num++] = i;
    for (int j = i + 1; j < n; j++) {
      if (p[j] < 0) continue;
      if (vol > 0) {
        p[j] -= vol;
        vol--;
      }
      p[j] -= ds;
      if (p[j] < 0) ds += d[j];
    }
  }
  cout << num << endl;
  if (num > 0) {
    cout << ans[0] + 1;
    for (int i = 1; i < num; i++) {
      cout << " " << ans[i] + 1;
    }
    cout << endl;
  }
  return 0;
}
