#include <bits/stdc++.h>
using namespace std;
const int N = 4005;
const int K = int(2e6) + 10;
const int MOD = int(1e9) + 7;
const int INF = int(1e9) + 5;
const long long INF64 = 1e18;
long long v[N], d[N], p[N];
bool present[N];
vector<int> ans;
void solve() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> v[i] >> d[i] >> p[i];
    present[i] = 1;
  }
  int cnt = 0;
  for (int i = 1; i <= n; i++) {
    if (!present[i]) continue;
    cnt++;
    ans.push_back(i);
    long long dec1 = v[i], dec2 = 0;
    for (int j = i + 1; j <= n; j++) {
      if (!present[j]) continue;
      p[j] -= (dec1 + dec2);
      if (p[j] < 0) {
        dec2 += d[j];
        present[j] = 0;
      }
      if (dec1 > 0) dec1--;
    }
  }
  cout << cnt << '\n';
  for (auto x : ans) cout << x << " ";
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t;
  t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
