#include <bits/stdc++.h>
using namespace std;
struct node {
  long long v, d, p;
} c[5000];
int a[5000];
int main() {
  int i, j, n, cnt = 0;
  long long t, sum;
  scanf("%d", &n);
  for (i = 1; i <= n; i++) scanf("%lld%lld%lld", &c[i].v, &c[i].d, &c[i].p);
  for (i = 1; i <= n; i++) {
    if (c[i].p >= 0) {
      a[cnt++] = i;
      t = 0;
      sum = 0;
      t = c[i].v;
      for (j = i + 1; j <= n; j++) {
        if (c[j].p < 0) continue;
        c[j].p -= t + sum;
        t--;
        if (t < 0) t = 0;
        if (c[j].p < 0) sum += c[j].d;
      }
    }
  }
  sort(a, a + cnt);
  printf("%d\n%d", cnt, a[0]);
  for (i = 1; i < cnt; i++) printf(" %d", a[i]);
  printf("\n");
  return 0;
}
