#include <bits/stdc++.h>
using namespace std;
const int symbol = 11, N = 4005, mod = 1e9 + 7;
long long v[N], d[N], p[N];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> v[i] >> d[i] >> p[i];
  vector<long long> vv;
  for (int i = 0; i < n; i++) {
    if (p[i] < 0) continue;
    long long dec = v[i], ans = 0;
    vv.push_back(i + 1);
    for (int j = i + 1; j < n; j++) {
      if (p[j] < 0) continue;
      p[j] -= (dec + ans);
      if (p[j] < 0) ans += d[j];
      dec = max(0ll, dec - 1);
    }
  }
  cout << vv.size() << "\n";
  for (auto x : vv) cout << x << " ";
  return 0;
}
