#include <bits/stdc++.h>
using namespace std;
long long p[5000], v[5000], d[5000], stat[5000];
vector<int> ans;
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> v[i] >> d[i] >> p[i];
    stat[i] = 1;
  }
  int cnt = 0;
  for (int i = 0; i < n; i++) {
    if (stat[i] == 0) continue;
    ans.push_back(i + 1);
    cnt++;
    long long k = 0;
    for (int j = i + 1; j < n; j++) {
      if (stat[j] == 0) continue;
      if ((v[i] - k) <= 0) break;
      p[j] = p[j] - (v[i] - k);
      k++;
    }
    long long x = 0;
    for (int j = i + 1; j < n; j++) {
      if (stat[j] == 0) continue;
      p[j] -= x;
      if (p[j] < 0) {
        stat[j] = 0;
        x += d[j];
      }
    }
  }
  cout << cnt << endl;
  for (int i = 0; i < ans.size(); i++) cout << ans[i] << " ";
  return 0;
}
