#include <bits/stdc++.h>
using namespace std;
int n, ans[4010], top;
struct node {
  int v, d, p, here;
  void scan(int i) {
    scanf("%d%d%d", &v, &d, &p);
    here = 1;
  }
} kid[4010];
void test(int j) {
  kid[j].here = 0;
  for (int k = j + 1; k <= n; k++) {
    if (!kid[k].here) continue;
    if (kid[k].p < 0) continue;
    kid[k].p -= kid[j].d;
  }
  for (int k = j + 1; k <= n; k++) {
    if (kid[k].here && kid[k].p < 0) test(k);
  }
}
int main() {
  while (~scanf("%d", &n)) {
    top = 0;
    for (int i = 1; i <= n; i++) kid[i].scan(i);
    for (int i = 1; i <= n; i++) {
      if (!kid[i].here) continue;
      ans[top++] = i;
      for (int j = i + 1; j <= n; j++) {
        if (kid[i].v <= 0) break;
        if (!kid[j].here) continue;
        kid[j].p -= kid[i].v--;
      }
      for (int j = i + 1; j <= n; j++) {
        if (kid[j].here && kid[j].p < 0) test(j);
      }
    }
    printf("%d\n", top);
    for (int i = 0; i < top; i++) printf("%d%c", ans[i], " \n"[i == top - 1]);
  }
  return 0;
}
