#include <bits/stdc++.h>
using namespace std;
const long long infl = 1e18 + 5;
long long int n, m, k, q, x, y, mx = -1, mn = infl, f, val, sz, sm, cnt, t = 1,
                                i, j, ind = -1;
long long int p[1000004], d[1000004], v[1000004];
std::vector<long long int> ans;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  if (fopen("inp.txt", "r")) {
    freopen("myfile.txt", "w", stdout);
    freopen("inp.txt", "r", stdin);
  }
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> v[i] >> d[i] >> p[i];
  }
  for (i = 0; i < n; i++) {
    if (p[i] >= 0) {
      ans.push_back(i + 1);
      x = v[i];
      cnt = 0;
      for (j = i + 1; j < n; j++) {
        if (p[j] - cnt < 0) {
          cnt += d[j];
          continue;
        }
        if (x == 0) break;
        p[j] -= x;
        x--;
      }
    } else {
      x = d[i];
      for (j = i + 1; j < n; j++) {
        p[j] -= x;
      }
    }
  }
  cout << (long long int)ans.size() << "\n";
  for (i = 0; i < (long long int)ans.size(); i++) cout << ans[i] << " ";
  return 0;
}
