#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, num1, num2, num3;
  vector<int> rpta;
  cin >> n;
  list<pair<long long, int> > v;
  list<long long> p;
  list<long long> d;
  for (int i = 0; i < n; i++) {
    cin >> num1 >> num2 >> num3;
    v.push_back(pair<int, int>(num1, i + 1));
    d.push_back(num2);
    p.push_back(num3);
  }
  list<pair<long long, int> >::iterator vit = v.begin();
  list<long long>::iterator pit = p.begin();
  list<long long>::iterator dit = d.begin();
  while (vit != v.end()) {
    rpta.push_back(vit->second);
    list<pair<long long, int> >::iterator vit2 = vit;
    list<long long>::iterator pit2 = pit;
    list<long long>::iterator dit2 = dit;
    vit2++;
    pit2++;
    dit2++;
    long long aux = vit->first;
    long long aux2 = 0;
    while (vit2 != v.end()) {
      *pit2 -= aux;
      *pit2 -= aux2;
      if (aux != 0) aux--;
      if (*pit2 < 0) {
        aux2 += (*dit2);
        vit2 = v.erase(vit2);
        pit2 = p.erase(pit2);
        dit2 = d.erase(dit2);
        continue;
      }
      vit2++;
      pit2++;
      dit2++;
    }
    vit++;
    pit++;
    dit++;
  }
  cout << rpta.size() << endl;
  cout << rpta[0];
  for (int i = 1; i < rpta.size(); i++) cout << " " << rpta[i];
  cout << endl;
  return 0;
}
