#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, i, j, k, tmp, other;
  cin >> n;
  long long v[n + 1], d[n + 1], p[n + 1], vis[n + 1];
  for (i = 1; i <= n; i++) cin >> v[i] >> d[i] >> p[i];
  memset(vis, 0, sizeof(vis));
  vector<long long> res;
  for (i = 1; i <= n; i++) {
    if (p[i] >= 0) {
      res.push_back(i);
      tmp = v[i];
      other = 0;
      for (j = i + 1; j <= n; j++) {
        if (vis[j] == 1) continue;
        p[j] -= (tmp + other);
        if (p[j] < 0) {
          other += d[j];
          vis[j] = 1;
        }
        if (tmp != 0) tmp--;
      }
    }
  }
  cout << res.size() << endl;
  for (i = 0; i < res.size(); i++) cout << res[i] << " ";
  return 0;
}
