#include <bits/stdc++.h>
using namespace std;
long n, res, c[5000], ans[5000];
struct child {
  long long v, d, p;
};
child a[5000];
int main() {
  scanf("%ld", &n);
  long long x, y, z;
  for (long i = 1; i <= n; ++i) {
    scanf("%I64d%I64d%I64d", &x, &y, &z);
    a[i].v = x, a[i].d = y, a[i].p = z;
  }
  for (long i = 1; i <= n; ++i)
    if (!c[i]) {
      x = 0;
      long long tmp = a[i].v;
      for (long j = i + 1; j <= n; ++j) {
        if (a[j].p >= 0) {
          a[j].p -= tmp + x;
          if (tmp > 0) --tmp;
          if (a[j].p < 0 && !c[j]) {
            x += a[j].d;
            c[j] = 1;
          }
        }
      }
      ans[++res] = i;
    }
  printf("%ld\n", res);
  for (long i = 1; i <= res; ++i) printf("%ld ", ans[i]);
  return 0;
}
