#include <bits/stdc++.h>
using namespace std;
struct node {
  int a, b, c;
  bool run;
} x[4002];
int cnt, k, ans[4002];
int main() {
  int i, j, p, n;
  scanf("%d", &n);
  for (i = 1; i <= n; i++) {
    scanf("%d%d%d", &x[i].a, &x[i].b, &x[i].c);
    x[i].run = false;
  }
  cnt = 0;
  for (i = 1; i <= n; i++) {
    if (x[i].c >= 0) {
      ans[++cnt] = i;
      k = x[i].a;
      for (j = i + 1; j <= n; j++) {
        if (x[j].c < 0) continue;
        x[j].c -= k;
        k--;
        if (k == 0) break;
      }
      for (j = i + 1; j <= n; j++) {
        if (x[j].c < 0 && (!x[j].run)) {
          x[j].run = true;
          for (p = j + 1; p <= n; p++)
            if (x[p].c >= 0) x[p].c -= x[j].b;
        }
      }
    } else
      continue;
  }
  printf("%d\n", cnt);
  for (i = 1; i < cnt; i++) printf("%d ", ans[i]);
  printf("%d\n", ans[cnt]);
}
