#include <bits/stdc++.h>
using namespace std;
struct Kid {
  int v, d;
  long long p;
  int id;
};
void Transform(vector<Kid>& q) {
  int idx = -1;
  for (int i = 0; i < q.size(); ++i) {
    if (q[i].p < 0) {
      idx = i;
      break;
    }
  }
  if (idx == -1) return;
  for (int i = idx + 1; i < q.size(); ++i) {
    q[i].p -= q[idx].d;
  }
  q.erase(q.begin() + idx);
  Transform(q);
}
int main() {
  int n;
  cin >> n;
  vector<Kid> q(n);
  int kid = 0;
  for (Kid& k : q) {
    cin >> k.v >> k.d >> k.p;
    k.id = kid++;
  }
  vector<int> ans;
  while (!q.empty()) {
    Kid k = q[0];
    q.erase(q.begin());
    assert(k.p >= 0);
    ans.push_back(k.id);
    for (int i = 0; i < min((int)q.size(), k.v); ++i) {
      q[i].p -= (k.v - i);
    }
    Transform(q);
  }
  cout << ans.size() << endl;
  for (int id : ans) {
    cout << id + 1 << " ";
  }
  cout << endl;
  return 0;
}
