#include <bits/stdc++.h>
using namespace std;
int v[4000 + 10], d[4000 + 10], p[4000 + 10];
int result[4000 + 10], check[1000000 + 10];
int main() {
  int n, a, b;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    cin >> v[i] >> d[i] >> p[i];
  }
  int lost = 0;
  for (int i = 0; i < n; i++) {
    if (p[i] >= 0) {
      result[lost++] = i + 1;
      long long q = v[i];
      long long k = 0;
      for (int j = i + 1; j < n; j++) {
        if (p[j] < 0) continue;
        p[j] -= q;
        p[j] -= k;
        if (q) q--;
        if (p[j] < 0 && k < 1e7) k += d[j];
      }
    }
  }
  printf("%d\n", lost);
  for (int i = 0; i < lost; i++) {
    printf("%d ", result[i]);
  }
  return 0;
}
