#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  std::ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cin >> n;
  vector<int64_t> v(n + 1, 0);
  vector<int64_t> p(n + 1, -1);
  vector<int64_t> d(n + 1, 0);
  vector<int64_t> a(n + 1, 0);
  vector<int64_t> c;
  c.reserve(n);
  int64_t sumd = 0;
  int64_t diff = 0;
  for (int i = 0; i < n; i++) {
    cin >> v[i] >> d[i] >> p[i];
  }
  for (int i = 0; i < n; i++) {
    if (p[i] >= 0) {
      sumd = 0;
      diff = 0;
      for (int j = i + 1; j < n; j++) {
        p[j] -= max((int64_t)0, v[i] - diff) + sumd;
        diff += 1 - a[j];
        if (a[j] == 0 && p[j] < 0) {
          sumd += d[j];
          a[j] = 1;
        }
      }
      c.push_back(i + 1);
    }
  }
  cout << c.size() << endl;
  for (int i = 0; i < c.size(); i++) {
    cout << c[i] << " ";
  }
  return 0;
}
