#include <bits/stdc++.h>
using namespace std;
const int N = 4005;
long long n, s, arr[N], a[N], b[N], c[N], out[N];
long long maxi(long long x, long long y) { return x > y ? x : y; }
int main() {
  scanf("%lld", &n);
  for (int i = 1; i <= n; i++) scanf("%lld %lld %lld", &a[i], &b[i], &c[i]);
  for (int i = 1; i <= n; i++) {
    if (out[i]) continue;
    arr[++s] = i;
    for (int j = i + 1; j <= n; j++) {
      if (out[j]) continue;
      c[j] -= maxi(0, a[i]--);
    }
    for (int j = i + 1; j <= n; j++)
      if (!out[j] && c[j] < 0) {
        out[j] = 1;
        for (int k = j + 1; k <= n; k++) c[k] -= b[j];
      }
  }
  printf("%lld\n", s);
  for (int i = 1; i <= s; i++) printf("%lld ", arr[i]);
}
