#include <bits/stdc++.h>
using namespace std;
const long long inf = 1000000000ll;
const long long inf64 = inf * inf;
const long long base = inf + 7;
const double pi = 3.1415926535897932384626433832795;
bool solve() {
  int n;
  scanf("%d", &n);
  vector<long long> v(n + 1), d(n + 1), p(n + 1);
  for (int i = 1; i <= n; i++) {
    int x, y, z;
    scanf("%d %d %d", &x, &y, &z);
    tie(v[i], d[i], p[i]) = make_tuple(x, y, z);
  }
  vector<int> ans;
  vector<bool> inQueue(n + 1, 1);
  for (int i = 1; i <= n; i++) {
    inQueue[i] = 0;
    if (p[i] < 0) {
    } else {
      ans.push_back(i);
      long long delt = 0;
      for (int j = i + 1; j <= n && delt <= v[i]; j++) {
        if (!inQueue[j]) continue;
        p[j] -= (v[i] - delt);
        delt++;
      }
      delt = 0;
      for (int j = i + 1; j <= n; j++) {
        if (!inQueue[j]) continue;
        p[j] -= delt;
        if (p[j] < 0) delt += d[j], inQueue[j] = 0;
      }
    }
  }
  int sz = (int)ans.size();
  printf("%d\n", sz);
  for (int i = 0; i < sz; i++) printf("%d ", ans[i]);
  puts("");
  return true;
}
int main() {
  solve();
  return 0;
}
