#include <bits/stdc++.h>
using namespace std;
int a[4100];
int v[4100], d[4100], p[4100];
int q[4100];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    scanf("%d%d%d", &v[i], &d[i], &p[i]);
    a[i] = i;
  }
  int tail = 0;
  while (n > 0) {
    q[tail++] = a[1];
    int id = a[1];
    for (int i = 1; i < n; ++i) a[i] = a[i + 1];
    n--;
    int now = v[id];
    for (int i = 1; i <= n; ++i) {
      if (now == 0) break;
      p[a[i]] -= now;
      now--;
    }
    while (true) {
      int flag = -1;
      for (int i = 1; i <= n; ++i) {
        if (p[a[i]] < 0) {
          flag = i;
          break;
        }
      }
      if (flag == -1) break;
      int now = a[flag];
      for (int i = flag; i < n; ++i) {
        a[i] = a[i + 1];
        if (p[a[i]] >= 0) p[a[i]] -= d[now];
      }
      n--;
    }
  }
  printf("%d\n", tail);
  for (int i = 0; i < tail; ++i) {
    printf("%d", q[i]);
    if (i == tail - 1)
      puts("");
    else
      printf(" ");
  }
}
