#include <bits/stdc++.h>
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
using namespace std;
using ll = long long;
using lld = long double;
const ll oo = 0x3f3f3f3f;
const ll MOD = 1000000007;
const ll N = 4004;
ll v[N], d[N], p[N], inQ[N];
ll d1[N], d2[N];
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  ll n;
  cin >> n;
  for (ll i = 0; i < n; i++) {
    cin >> v[i] >> d[i] >> p[i];
    inQ[i] = 1;
  }
  vector<ll> ans;
  for (ll i = 0; i < n; i++) {
    if (inQ[i] == 0) continue;
    ll x = v[i];
    ll dam = 0;
    for (ll j = i + 1; j < n; j++) {
      if (inQ[j] == 0) continue;
      p[j] -= max(x, 0LL);
      x--;
      p[j] -= dam;
      if (p[j] < 0) {
        inQ[j] = 0;
        dam += d[j];
      }
    }
    ans.push_back(i + 1);
  }
  cout << ans.size() << '\n';
  for (auto i : ans) cout << i << " ";
  cout << "\n";
  return 0;
}
