#include <bits/stdc++.h>
using namespace std;
long long N, x, cd, len, l, r;
long long ans[4010], q[4010];
long long V[4010], D[4010], P[4010];
bool dead[4010];
void escape(long long x) {
  dead[x] = 1;
  for (long long j = x + 1; j <= N; j++)
    if (!dead[x]) {
      P[j] -= D[x];
      if (P[j] < 0) escape(j);
    }
}
int main() {
  scanf("%I64d", &N);
  for (long long i = 1; i <= N; i++)
    scanf("%I64d%I64d%I64d", &V[i], &D[i], &P[i]);
  for (long long i = 1; i <= N; i++) {
    if (dead[i]) continue;
    cd++;
    ans[++len] = i;
    x = V[i];
    l = 1;
    r = 0;
    for (long long j = i + 1; x > 0 && j <= N; j++) {
      if (dead[j]) continue;
      P[j] -= x;
      if (P[j] < 0) {
        q[++r] = j;
        dead[j] = 1;
      }
      x--;
    }
    for (; l <= r; l++) {
      x = q[l];
      for (long long j = x + 1; j <= N; j++) {
        if (dead[j]) continue;
        P[j] -= D[x];
        if (P[j] < 0) {
          q[++r] = j;
          dead[j] = 1;
        }
      }
    }
  }
  printf("%I64d\n", cd);
  for (long long i = 1; i <= len; i++) {
    printf("%I64d", ans[i]);
    if (i < len) printf(" ");
  }
}
