#include <bits/stdc++.h>
using namespace std;
using namespace std;
int gcd(int a, int b) {
  while (b) {
    a %= b;
    swap(a, b);
  }
  return a;
}
void solve() {
  int n;
  cin >> n;
  vector<long> d(n), v(n), p(n);
  vector<bool> b(n, true);
  for (int i = 0; i < n; ++i) cin >> v[i] >> d[i] >> p[i];
  vector<int> ans;
  for (int cur = 0; cur < n; ++cur) {
    int firstPos = -1;
    for (int i = 0; i < n; ++i)
      if (b[i] && p[i] >= 0) {
        firstPos = i;
        break;
      }
    int firstNeg = -1;
    for (int i = 0; i < n; ++i)
      if (b[i] && p[i] < 0) {
        firstNeg = i;
        break;
      }
    if (firstNeg >= 0) {
      b[firstNeg] = false;
      for (int i = firstNeg + 1; i < n; ++i)
        if (b[i] && p[i] >= 0) p[i] -= d[firstNeg];
    } else {
      b[firstPos] = false;
      ans.push_back(firstPos + 1);
      long minus = v[firstPos];
      for (int i = firstPos + 1; i < n; ++i)
        if (b[i]) {
          if (p[i] >= 0) p[i] -= minus;
          minus = max(0L, minus - 1);
        }
    }
  }
  cout << ans.size() << endl;
  for (int i = 0; i < ans.size(); ++i) cout << ans[i] << " ";
}
int main() {
  solve();
  return 0;
}
