#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e4;
long long v[maxn];
long long d[maxn];
long long p[maxn];
bool mark[maxn];
int n;
vector<int> ans;
queue<int> cry;
void fix() {
  while (!cry.empty()) {
    int x = cry.front();
    cry.pop();
    for (int i = x + 1; i < n; i++) {
      p[i] -= d[x];
      if (mark[i] == false && p[i] < 0) {
        mark[i] = true;
        cry.push(i);
      }
    }
  }
  return;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie();
  cout.tie();
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> v[i] >> d[i] >> p[i];
  }
  for (int i = 0; i < n; i++) {
    if (mark[i] == false) {
      ans.push_back(i + 1);
      int bank = v[i];
      for (int j = i + 1; j < n && bank > 0; j++) {
        if (mark[j] == false) {
          p[j] -= bank;
          bank--;
          if (p[j] < 0) {
            cry.push(j);
            mark[j] = 1;
          }
        }
      }
    }
    fix();
  }
  cout << ans.size() << endl;
  for (int i = 0; i < ans.size(); i++) {
    cout << ans[i] << " ";
  }
  return 0;
}
