#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  long long n;
  cin >> n;
  long long v[4100];
  long long c[4100];
  long long d[4100];
  long long prev[4100];
  long long next[4100];
  for (long long i = 0; i < n; i++) {
    cin >> v[i] >> d[i] >> c[i];
    next[i] = i + 1;
    prev[i] = i - 1;
  }
  long long pos = 0;
  vector<long long> sol;
  while (pos < n) {
    sol.push_back(pos);
    long long act = v[pos];
    long long extra = 0;
    long long p = next[pos];
    while (p < n) {
      c[p] -= (extra + act);
      if (c[p] < 0) {
        next[prev[p]] = next[p];
        prev[next[p]] = prev[p];
        extra += d[p];
      }
      p = next[p];
      act = (act ? act - 1 : 0);
    }
    pos = next[pos];
  }
  cout << sol.size() << endl;
  for (long long i = 0; i < sol.size(); i++) cout << sol[i] + 1 << ' ';
  cout << endl;
}
