#include <bits/stdc++.h>
using namespace std;
struct child {
  long long room, hall, brave;
};
vector<child> a(5000);
vector<bool> stay(5000, true);
long long n;
int main() {
  cin >> n;
  long long i, j;
  for (i = 1; i <= n; i++) cin >> a[i].room >> a[i].hall >> a[i].brave;
  vector<long long> ans;
  for (i = 1; i <= n; i++) {
    if (a[i].brave >= 0) {
      long long cur;
      ans.push_back(i);
      for (j = a[i].room, cur = i + 1; j > 0; j--, cur++) {
        if (cur > n) break;
        a[cur].brave -= j;
        if (!stay[cur]) j++;
      }
      long long decr = 0;
      for (j = i + 1; j <= n; j++) {
        a[j].brave -= decr;
        if (a[j].brave < 0 && stay[j]) {
          decr += a[j].hall;
          stay[j] = false;
        }
      }
    }
  }
  cout << ans.size() << endl;
  for (i = 0; i < ans.size(); i++) cout << ans[i] << " ";
  return 0;
}
