#include <bits/stdc++.h>
using namespace std;
const int maxn = 4000 + 100;
int n;
bool is[maxn];
long long v[maxn], d[maxn], p[maxn];
vector<int> ans;
int main() {
  ios::sync_with_stdio(false);
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> v[i] >> d[i] >> p[i];
    is[i] = true;
  }
  for (int i = 0; i < n; i++) {
    if (!is[i]) continue;
    ans.push_back(i);
    long long red = v[i];
    for (int j = i + 1; j < n && red >= 0; j++) {
      if (!is[j]) continue;
      p[j] -= red;
      red--;
    }
    red = 0;
    for (int j = i + 1; j < n; j++) {
      if (!is[j]) continue;
      p[j] -= red;
      if (p[j] < 0) {
        red += d[j];
        is[j] = false;
      }
    }
  }
  cout << ((int(ans.size()))) << endl;
  for (int i = 0; i < ((int(ans.size()))); i++) cout << ans[i] + 1 << " ";
  return 0;
}
