#include <bits/stdc++.h>
using namespace std;
const int maxn = 4010, inf = 1e9;
long long int n, a[maxn], d[maxn], c[maxn], ans, t, f;
queue<int> q;
bool mark[maxn];
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i] >> d[i] >> c[i];
  for (int i = 0; i < n; i++) {
    f = a[i];
    t = 0;
    if (c[i] >= 0) {
      ans++;
      q.push(i + 1);
      for (int j = i + 1; j < n; j++) {
        c[j] -= a[i];
        if (t < f && !mark[j]) {
          a[i]--;
          t++;
        }
        if (c[j] < 0 && !mark[j]) {
          a[i] += d[j];
          mark[j] = 1;
        }
      }
    }
  }
  cout << ans << endl;
  while (!q.empty()) {
    cout << q.front() << " ";
    q.pop();
  }
  cout << endl;
  return 0;
}
