#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  long long v[4001], d[4001], p[4001];
  vector<int> result;
  bool ran[4001];
  long long sum;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> v[i] >> d[i] >> p[i];
    ran[i] = false;
  }
  for (int i = 0; i < n; ++i) {
    if (ran[i]) continue;
    result.push_back(i + 1);
    sum = 0;
    for (int j = i + 1; j < n; ++j) {
      if (!ran[j]) {
        if (v[i] > 0) p[j] -= v[i]--;
        p[j] -= sum;
        if (p[j] < 0) {
          ran[j] = true;
          sum += d[j];
        }
      }
    }
  }
  cout << result.size() << endl;
  for (int i = 0; i < result.size(); ++i) cout << result[i] << " ";
  cout << endl;
  return 0;
}
