#include <bits/stdc++.h>
using namespace std;
struct fuck {
 public:
  int v, d, p;
};
fuck s[4567];
int ans[4567];
int cha[4567];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d %d %d", &s[i].v, &s[i].d, &s[i].p);
  int num = 0;
  for (int i = 1; i <= n; i++) {
    if (s[i].p >= 0) {
      ans[num++] = i;
      int voice = s[i].v;
      int low = 0;
      int k, j;
      memset(cha, 0, sizeof(cha));
      for (j = i + 1; j <= n; j++) {
        cha[j] = cha[j - 1];
        if (voice <= 0) break;
        if (s[j].p >= 0) {
          s[j].p = s[j].p - voice;
          voice--;
          if (s[j].p < 0) cha[j] = cha[j - 1] + s[j].d;
        }
      }
      for (k = i + 1; k < j; k++) {
        if (s[k].p >= 0) {
          s[k].p = s[k].p - cha[k] - low;
          if (s[k].p < 0) low += s[k].d;
        }
      }
      low += cha[j];
      for (; k <= n; k++) {
        if (s[k].p >= 0) {
          s[k].p = s[k].p - low;
          if (s[k].p < 0) low += s[k].d;
        }
      }
    }
  }
  printf("%d\n1", num);
  for (int i = 1; i < num; i++) printf(" %d", ans[i]);
  printf("\n");
  return 0;
}
