#include <bits/stdc++.h>
using namespace std;
bool exist[4005];
int main() {
  int n;
  cin >> n;
  memset(exist, 1, sizeof exist);
  long long v[n], d[n], p[n];
  for (int i = 0; i < n; i++) {
    cin >> v[i] >> d[i] >> p[i];
  }
  for (int i = 0; i < n; i++) {
    if (exist[i]) {
      long long vol = v[i], j = i + 1, foo = 0;
      while (vol && j < n) {
        if (exist[j]) {
          p[j] -= vol;
          if (p[j] < 0) {
            exist[j] = 0;
            vol += d[j], foo += d[j];
          }
          if (vol > foo) vol--;
        }
        j++;
      }
    }
  }
  int res = 0;
  for (int i = 0; i < n; i++) {
    if (exist[i]) res++;
  }
  cout << res << endl;
  for (int i = 0; i < n; i++) {
    if (exist[i]) cout << i + 1 << " ";
  }
  return 0;
}
