#include <bits/stdc++.h>
using namespace std;
template <class T>
inline T gcd(T a, T b) {
  while (b) {
    a %= b;
    swap(a, b);
  }
  return a;
}
template <class T>
inline T lcm(T a, T b) {
  return a / gcd(a, b) * b;
}
inline int nxt() {
  int wow;
  scanf("%d", &wow);
  return wow;
}
inline long long int lxt() {
  long long int wow;
  scanf("%lld", &wow);
  return wow;
}
inline double dxt() {
  double wow;
  scanf("%lf", &wow);
  return wow;
}
struct child {
  long long int v, d, p;
  int id, done, scared;
  child() { scared = 0; }
};
vector<child> c;
int main() {
  int n = nxt(), ans = 0;
  for (int i = 0; i < n; i++) {
    child temp;
    scanf("%I64d %I64d %I64d", &temp.v, &temp.d, &temp.p);
    temp.id = i;
    c.push_back(temp);
  }
  for (int i = 0; i < n; i++) {
    if (c[i].scared) continue;
    ans++;
    long long int val = c[i].v;
    for (int j = i + 1; j < n; j++) {
      if (c[j].scared) continue;
      c[j].p -= val;
      val = max(0LL, val - 1);
    }
    for (int j = i + 1; j < n; j++) {
      if (c[j].scared == 0 && c[j].p < 0) {
        c[j].scared = 1;
        for (int k = j + 1; k < n; k++) c[k].p -= c[j].d;
      }
    }
  }
  printf("%d\n", ans);
  for (int i = 0; i < n; i++)
    if (c[i].scared == 0) printf("%d ", i + 1);
  puts("");
  return 0;
}
