#include <bits/stdc++.h>
using namespace std;
long long v[5000], d[5000], p[5000];
bool lea[5000];
int main() {
  int i, j, n, l, q, k = 0, ans[5000], x, f;
  scanf("%d", &n);
  for (i = 1; i <= n; i++)
    scanf(
        "%I64d"
        "%I64d"
        "%I64d",
        v + i, d + i, p + i);
  for (i = 1; i <= n; i++) {
    if (!lea[i]) {
      ans[k++] = i;
      lea[i] = true;
      x = 0;
      for (l = i + 1; l <= n && x < v[i]; l++, x++) {
        if (!lea[l])
          p[l] -= (v[i] - x);
        else
          x--;
      }
      while (1) {
        f = 0;
        for (j = i + 1; j <= n; j++)
          if (!lea[j] && p[j] < 0) f = 1;
        if (f == 0) break;
        for (j = i + 1; j <= n; j++) {
          if (!lea[j] && p[j] < 0) {
            lea[j] = true;
            for (q = j + 1; q <= n; q++) {
              if (!lea[q]) {
                p[q] -= d[j];
              }
            }
          }
        }
      }
    }
  }
  printf("%d\n", k);
  for (i = 0; i < k; i++) printf("%d%c", ans[i], i == k - 1 ? '\n' : ' ');
  return 0;
}
