#include <bits/stdc++.h>
using namespace std;
vector<pair<long long, long long>> mul;
long long n, a, b;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n;
  vector<long long> v(n), d(n), p(n);
  for (int i = 0; i < n; i++) cin >> v[i] >> d[i] >> p[i];
  vector<int> done(n), ans;
  for (int i = 0; i < n; i++) {
    int ind = -1;
    for (int j = i; j < n; j++) {
      if (!done[j]) {
        ind = j;
        break;
      }
    }
    if (ind == -1) break;
    ans.push_back(ind);
    long long curvol = v[ind], addi = 0;
    for (int j = ind + 1; j < n; j++) {
      if (!done[j]) {
        p[j] -= (curvol - addi);
        addi++;
        if (addi == curvol) break;
      }
    }
    long long minu = 0;
    for (int j = ind + 1; j < n; j++) {
      if (!done[j]) {
        p[j] -= minu;
        if (p[j] < 0) {
          minu += d[j];
          done[j] = 1;
        }
      }
    }
    i = ind;
  }
  cout << ans.size() << "\n";
  for (int p : ans) cout << p + 1 << " ";
  return 0;
}
