#include <bits/stdc++.h>
using namespace std;
const int INF = 10;
const int MAX = 200047;
const int MAXD = 100047;
int n;
vector<int> ans;
int v[5000], d[5000], p[5000];
int main() {
  cin >> n;
  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) {
      vector<int> q;
      ans.push_back(i + 1);
      for (int j = (i + 1); j < (n); j++) {
        if (v[i] == 0) break;
        if (p[j] >= 0) {
          p[j] -= v[i];
          if (p[j] < 0) q.push_back(j);
          v[i]--;
        }
      }
      while (q.size()) {
        vector<int> q2;
        for (int e = (0); e < (q.size()); e++) {
          int ggg = q[e];
          for (int j = (ggg + 1); j < (n); j++) {
            if (p[j] >= 0) {
              p[j] -= d[ggg];
              if (p[j] < 0) q2.push_back(j);
            }
          }
        }
        q = q2;
      }
    }
  }
  cout << ans.size() << endl;
  for (int i = (0); i < (ans.size()); i++) cout << ans[i] << " ";
  return 0;
}
