#include <bits/stdc++.h>
using namespace std;
struct Child {
  int idx, cur, hall, conf;
};
int main() {
  int n;
  cin >> n;
  list<Child> line;
  for (int i = 0; i < n; i++) {
    int v, d, p;
    cin >> v >> d >> p;
    line.push_back((Child){i + 1, v, d, p});
  }
  for (auto i = line.begin(); i != line.end(); i++) {
    int cry = i->cur;
    auto j = i;
    advance(j, 1);
    while (j != line.end()) {
      j->conf -= cry;
      cry = max(0, cry - 1);
      j++;
    }
    j = i;
    advance(j, 1);
    while (j != line.end()) {
      if (j->conf < 0) {
        auto k = j;
        advance(k, 1);
        while (k != line.end()) {
          if (k->conf >= 0) k->conf -= j->hall;
          k++;
        }
        k = j, advance(k, 1);
        line.erase(j), j = k;
      } else {
        j++;
      }
    }
  }
  cout << line.size() << endl;
  for (auto i = line.begin(); i != line.end(); i++) cout << i->idx << ' ';
  return 0;
}
