#include <bits/stdc++.h>
int main() {
  long long n, i, j, k, l, v[4000], o[4000], c[4000], temp[4000], count, br;
  while (scanf("%I64d", &n) != EOF) {
    l = count = 0;
    br = 0;
    for (i = 0; i < n; i++) {
      scanf("%I64d %I64d %I64d", &v[i], &o[i], &c[i]);
    }
    for (i = 0; i < n; i++) {
      if (c[i] >= 0 && v[i] != -1000001) {
        count = count + 1;
        temp[br] = i + 1;
        br++;
      }
      for (j = i + 1; j < n; j++) {
        if (c[i] >= 0 && v[j] != -1000001) {
          c[j] = c[j] - v[i];
          if (v[i] != 0) v[i] = v[i] - 1;
        } else if (c[i] < 0 && v[i] != -1000001 && v[j] != -1000001) {
          c[j] = c[j] - o[i];
        }
      }
      for (k = i + 1; k < n; k++) {
        if (c[k] < 0 && v[k] != -1000001) {
          v[k] = -1000001;
          for (l = k + 1; l < n; l++) {
            c[l] = c[l] - o[k];
          }
        }
      }
    }
    temp[br] = '\0';
    printf("%I64d\n", count);
    for (i = 0; i < count; i++) {
      printf("%I64d ", temp[i]);
    }
    printf("\n");
  }
  return 0;
}
