#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-8;
const int INF = (1 << 30) - 1;
const int MAXN = 4010;
int n;
long long v[MAXN], d[MAXN], p[MAXN];
long long los[MAXN];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    int a, b, c;
    scanf("%d%d%d", &a, &b, &c);
    v[i] = a;
    d[i] = b;
    p[i] = c;
  }
  long long cur = 0;
  vector<int> g;
  g.clear();
  for (int i = 1; i <= n; ++i) {
    if (los[i]) continue;
    if (p[i] >= 0) {
      g.push_back(i);
      long long k = v[i], vv = 0;
      for (int j = i + 1; j <= n; ++j)
        if (los[j] == 0) {
          if (p[j] < 0) {
            vv += d[j];
            los[j] = 1;
          } else {
            p[j] -= (k + vv);
            if (p[j] < 0) {
              vv += d[j];
              los[j] = 1;
            }
            if (k > 0) --k;
          }
        }
    } else {
      los[i] = 1;
      long long k = d[i];
      for (int j = i + 1; j <= n; ++j) {
        p[j] -= k;
      }
    }
  }
  printf("%d\n", (int)g.size());
  for (int i = 0; i < g.size(); ++i) printf("%d ", g[i]);
  puts("");
  return 0;
}
