#include <bits/stdc++.h>
using namespace std;
long long M = 1e9 + 7;
long long v[1000010], d[1000010], pt[1000010], b[1000010];
int main() {
  long long i, j, k, n, m;
  scanf("%I64d", &n);
  long long count1 = 0;
  for (i = 0; i < n; i++) scanf("%I64d%I64d%I64d", &v[i], &d[i], &pt[i]);
  long long cry = 0;
  for (i = 0; i < n; i++) {
    long long o = 0;
    if (pt[i] - cry >= 0) {
      long long count2 = 0, cry2 = cry;
      for (j = i + 1; j < n; j++) {
        if (pt[j] - cry2 >= 0) {
          pt[j] -= (max(v[i] - count2, o));
          count2++;
        } else
          cry2 += d[j];
      }
      b[count1++] = i + 1;
    } else {
      cry += d[i];
    }
  }
  printf("%I64d\n", count1);
  for (i = 0; i < count1; i++) printf("%I64d ", b[i]);
  printf("\n");
  return 0;
}
