#include <bits/stdc++.h>
using namespace std;
int const N = 6000;
vector<int> sol;
long long v[N], d[N], p[N];
bool out[N];
int main() {
  int n;
  long long dj = 0;
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) scanf("%lld%lld%lld", &v[i], &d[i], &p[i]);
  for (int i = 0; i < n; ++i) {
    if (p[i] >= 0 && out[i] == 0) {
      out[i] = 1;
      sol.push_back(i + 1);
      for (int j = i + 1; j < n && v[i]; j++) {
        if (out[j] == 0) {
          p[j] -= v[i];
          v[i]--;
        }
      }
    }
    for (int j = 0; j < n; ++j) {
      if (out[j] == 0 && p[j] < 0) {
        out[j] = 1;
        for (int k = j + 1; k < n; ++k) {
          p[k] -= d[j];
        }
      }
    }
  }
  cout << sol.size() << endl;
  for (int i = 0; i < sol.size(); ++i) printf("%d ", sol[i]);
}
