#include <bits/stdc++.h>
using namespace std;
long long n;
long long v[5000], d[5000], p[5000], x[5000];
long long g, gg;
vector<long long> s;
long long k;
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> v[i] >> d[i] >> p[i];
  }
  for (int i = 0; i < n; i++) {
    if (x[i] == 1) {
      continue;
    }
    s.push_back(i + 1);
    g = v[i];
    gg = i + 1;
    while (g > 0 && gg < n) {
      if (x[gg] == 1) {
        gg++;
        continue;
      }
      p[gg] -= g;
      g--;
      gg++;
    }
    for (int o = i + 1; o < n; o++) {
      if (p[o] < 0 && x[o] == 0) {
        x[o] = 1;
        for (int q = o + 1; q < n; q++) {
          p[q] -= d[o];
        }
      }
    }
  }
  cout << s.size() << endl;
  ;
  sort(s.begin(), s.end());
  for (int i = 0; i < s.size(); i++) {
    cout << s[i] << ' ';
  }
}
