#include <bits/stdc++.h>
using namespace std;
const int nmax = (int)4e3 + 10;
long long v[nmax], d[nmax], p[nmax];
bool out[nmax] = {false};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  for (int i = (int)0; i <= (int)n - 1; i++) {
    cin >> v[i] >> d[i] >> p[i];
  }
  vector<int> ans;
  for (int i = (int)0; i <= (int)n - 1; i++) {
    if (out[i]) continue;
    ans.push_back(i + 1);
    long long loud = v[i];
    long long cry = 0;
    for (int j = (int)i + 1; j <= (int)n - 1; j++) {
      if (out[j]) continue;
      p[j] -= loud;
      p[j] -= cry;
      if (loud > 0) loud--;
      if (p[j] < 0) {
        out[j] = true;
        cry += d[j];
      }
    }
  }
  cout << ans.size() << endl;
  for (int i = (int)0; i <= (int)ans.size() - 1; i++) {
    cout << ans[i] << " ";
  }
  cout << endl;
  return 0;
}
