#include <bits/stdc++.h>
using namespace std;
inline int in() {
  int res = 0;
  char c;
  while ((c = getchar()) < '0' || c > '9')
    ;
  while (c >= '0' && c <= '9') res = res * 10 + c - '0', c = getchar();
  return res;
}
const int N = 4010;
struct st {
  long long v, d, p;
} a[N];
int ans[N];
bool out[N];
queue<int> q;
void fun(int x, int y, int n) {
  q.push(x);
  out[x] = 1;
  while (!q.empty()) {
    int now = q.front();
    q.pop();
    out[now] = 1;
    int lound = a[now].d;
    for (int i = now + 1; i <= n; i++) {
      if (!out[i]) {
        a[i].p -= lound;
        if (a[i].p < 0) {
          out[i] = 1;
          q.push(i);
        }
      }
    }
  }
}
int main() {
  int n = in();
  for (int i = 1; i <= n; i++) {
    a[i].v = in(), a[i].d = in(), a[i].p = in();
  }
  int cnt = 0;
  for (int i = 1; i <= n; i++) {
    if (!out[i]) {
      ans[cnt++] = i;
      for (int j = i + 1; j <= n && a[i].v; j++) {
        if (!out[j]) {
          a[j].p -= a[i].v;
          a[i].v--;
        }
      }
      for (int j = i + 1; j <= n; j++) {
        if (!out[j]) {
          if (a[j].p < 0) {
            out[j] = 1;
            for (int k = j + 1; k <= n; k++) {
              if (out[k]) continue;
              a[k].p -= a[j].d;
              if (a[k].p < 0) {
                out[k] = 1;
                a[j].d += a[k].d;
              }
            }
            break;
          }
        }
      }
    }
  }
  printf("%d\n", cnt);
  for (int i = 0; i < cnt; i++) {
    printf("%d ", ans[i]);
  }
  return 0;
}
