#include <bits/stdc++.h>
using namespace std;
int N;
long long v[5000], d[5000], p[5000];
vector<int> sl;
int main() {
  cin >> N;
  for (int i = 1; i <= N; ++i) {
    cin >> v[i] >> d[i] >> p[i];
  }
  for (int i = 1; i <= N; ++i) {
    if (p[i] < 0) continue;
    sl.push_back(i);
    long long cnt = v[i];
    long long cnt1 = 0;
    for (int j = i + 1; j <= N; j++) {
      if (p[j] < 0) continue;
      p[j] -= max(cnt, 0LL) + cnt1;
      if (p[j] < 0) cnt1 += d[j];
      cnt--;
    }
  }
  cout << sl.size() << endl;
  for (int i = 0; i < sl.size(); ++i) cout << sl[i] << " ";
  return 0;
}
