#include <bits/stdc++.h>
int INF = 2147483647;
double INFD = 2147483647;
double PI = 3.14159265359;
using namespace std;
struct Child {
  Child(long long v_, long long d_, long long p_) {
    gone = false;
    v = v_;
    d = d_;
    p = p_;
  }
  bool gone;
  long long v;
  long long d;
  long long p;
};
int Enter(vector<Child>& kids, int base) {
  long long v = kids[base].v, deduction = 0;
  int gone_kid = -1;
  kids[base].gone = true;
  base++;
  while (deduction < v && base < kids.size()) {
    if (!kids[base].gone) {
      kids[base].p -= v - deduction;
      if (kids[base].p < 0 && gone_kid == -1) {
        gone_kid = base;
      }
      deduction++;
    }
    base++;
  }
  return gone_kid;
}
void print(vector<Child>& kids) {
  int i = 0;
  while (i < kids.size()) {
    Child c = kids[i];
    cout << i + 1 << ": " << c.v << " " << c.d << " " << c.p;
    if (c.gone) {
      cout << " --------";
    }
    cout << endl;
    i++;
  }
}
void Deduce(vector<Child>& kids, int base) {
  long long deduction = 0;
  int i = base;
  while (i < kids.size()) {
    if (!kids[i].gone) {
      kids[i].p -= deduction;
      if (kids[i].p < 0) {
        kids[i].gone = true;
        deduction += kids[i].d;
      }
    }
    i++;
  }
}
int main() {
  int n = 0;
  cin >> n;
  vector<Child> kids(n, Child(0, 0, 0));
  vector<int> entered;
  int i = 0;
  while (i < n) {
    cin >> kids[i].v >> kids[i].d >> kids[i].p;
    i++;
  }
  i = 0;
  while (i < n) {
    if (!kids[i].gone) {
      entered.push_back(i);
      int gone_kid = Enter(kids, i);
      if (gone_kid != -1) {
        Deduce(kids, gone_kid);
      }
    }
    i++;
  }
  cout << entered.size() << endl;
  i = 0;
  while (i < entered.size()) {
    if (i) {
      cout << " ";
    }
    cout << entered[i] + 1;
    i++;
  }
  cout << endl;
  return 0;
}
