#include <bits/stdc++.h>
using namespace std;
const int N = 4005;
int n;
struct child {
  long long v, d, p;
  int idx;
  child(long long v, long long d, long long p, int idx)
      : v(v), d(d), p(p), idx(idx) {}
};
long long v, d, p;
vector<child *> ve;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  for (int i = (0); i < (n); i++) {
    cin >> v >> d >> p;
    ve.push_back(new child(v, d, p, i));
  }
  vector<int> ans;
  while (!ve.empty()) {
    ans.push_back(ve[0]->idx);
    ve[0]->p = -1;
    for (int i = (1); i < (((int)(ve).size())); i++) {
      ve[i]->p -= max(0LL, ve[0]->v - i + 1);
      if (ve[i]->p < 0) {
        for (int j = (i + 1); j < (((int)(ve).size())); j++) {
          ve[j]->p -= ve[i]->d;
        }
      }
    }
    ve.erase(stable_partition((ve).begin(), (ve).end(),
                              [&](child *c) { return c->p >= 0; }),
             ve.end());
  }
  cout << ((int)(ans).size()) << '\n';
  for (int x : ans) {
    cout << x + 1 << ' ';
  }
  cout << '\n';
}
