#include <bits/stdc++.h>
using namespace std;
const int N = 4e3 + 5, MOD = 1e9 + 7;
long long n, v[N], d[N], conf[N];
vector<int> ans;
int main() {
  std::ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n;
  for (long long i = 1; i <= n; i++) cin >> v[i] >> d[i] >> conf[i];
  for (long long i = 1; i <= n; i++) {
    if (conf[i] < 0) continue;
    ans.push_back(i);
    long long cnt = v[i], cnt2 = 0;
    for (long long j = i + 1; j <= n; j++) {
      if (conf[j] < 0) continue;
      conf[j] = conf[j] - (cnt + cnt2);
      if (conf[j] < 0) {
        cnt2 += d[j];
      }
      if (cnt) --cnt;
    }
  }
  cout << ans.size() << "\n";
  for (long long i = 0; i < ans.size(); i++) cout << ans[i] << " ";
}
