#include <bits/stdc++.h>
using namespace std;
const long long N = 40010;
inline long long read() {
  long long x(0), w(1);
  char c = getchar();
  while (c ^ '-' && (c < '0' || c > '9')) c = getchar();
  if (c == '-') w = -1, c = getchar();
  while (c >= '0' && c <= '9') x = (x << 3) + (x << 1) + c - '0', c = getchar();
  return x * w;
}
long long n, vol, sz, cnt, v[N], d[N], p[N], away[N];
vector<long long> ans;
signed main() {
  n = read();
  for (long long i = 1; i <= n; ++i) {
    v[i] = read();
    d[i] = read();
    p[i] = read();
  }
  for (long long i = 1; i <= n; ++i) {
    if (away[i]) continue;
    ans.push_back(i);
    vol = v[i];
    cnt = 0;
    for (long long j = i + 1; j <= n; ++j) {
      if (away[j]) continue;
      ++cnt;
      p[j] -= vol;
      if (p[j] < 0) {
        away[j] = 1;
        vol += d[j];
      }
      if (cnt <= v[i]) --vol;
    }
  }
  printf("%lld\n", sz = (long long)ans.size());
  for (long long i = 0; i < sz; ++i) {
    printf("%lld ", ans[i]);
  }
  printf("\n");
  return 0;
}
