#include <bits/stdc++.h>
using namespace std;
const int nmax = 4000 + 10;
long long v[nmax], d[nmax], p[nmax], ok[nmax];
long long n, i, j, k, z;
vector<long long> res;
int main() {
  cin >> n;
  for (i = 1; i <= n; ++i) cin >> v[i] >> d[i] >> p[i];
  for (i = 1; i <= n; ++i) {
    if (p[i] < 0) {
      if (ok[i] == false)
        for (j = i + 1; j <= n; ++j) p[j] -= d[i];
      continue;
    } else {
      k = v[i];
      z = 0;
      for (j = i + 1; j <= n; ++j) {
        p[j] -= z;
        if (p[j] < 0) {
          if (ok[j] == false) z += d[j];
          ok[j] = 1;
        } else {
          if (k > 0) p[j] -= k;
          k -= 1;
        }
      }
      res.push_back(i);
    }
  }
  cout << res.size() << '\n';
  for (i = 0; i < res.size(); ++i) cout << res[i] << " ";
  cout << '\n';
}
