#include <bits/stdc++.h>
using namespace std;
template <typename T>
T gcd(T a, T b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
template <typename T>
T pow(T a, T b, long long m) {
  T ans = 1;
  while (b > 0) {
    if (b % 2 == 1) ans = (ans * a) % m;
    b /= 2;
    a = (a * a) % m;
  }
  return ans % m;
}
int gr[4005];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int n;
  cin >> n;
  long long v[n], d[n], p[n];
  vector<long long> ans;
  int x, cnt;
  for (int i = 0; i < n; i++) {
    cin >> v[i] >> d[i] >> p[i];
  }
  for (int i = 0; i < n; i++) {
    if (p[i] >= 0) {
      ans.push_back(i + 1);
      x = v[i];
      cnt = 0;
      for (int j = i + 1; j < n; j++) {
        if (p[j] - cnt < 0) {
          cnt += d[j];
          continue;
        }
        if (x == 0) continue;
        p[j] -= x;
        x--;
      }
    } else {
      x = d[i];
      for (int j = i + 1; j < n; j++) p[j] -= x;
    }
  }
  cout << ans.size() << "\n";
  for (int i = 0; i < ans.size(); i++) cout << ans[i] << " ";
}
