#include <bits/stdc++.h>
using namespace std;
const int MAXN = 4010;
int N;
long long V[MAXN], D[MAXN], P[MAXN];
set<int> st;
int main() {
  if (fopen("input.txt", "r")) {
    freopen("input.txt", "r", stdin);
  }
  ios::sync_with_stdio(false);
  cin >> N;
  for (int i = 1; i <= N; i++) {
    cin >> V[i] >> D[i] >> P[i];
    st.insert(i);
  }
  vector<int> ans;
  while (!st.empty()) {
    int b = *st.begin();
    ans.push_back(b);
    st.erase(st.begin());
    long long val = V[b];
    for (int i : st) {
      P[i] -= val;
      val--;
      if (val == 0) {
        break;
      }
    }
    for (auto it = st.begin(); it != st.end();) {
      int i = *it;
      if (P[i] >= 0) {
        it++;
        continue;
      }
      st.erase(it++);
      for (auto jt = it; jt != st.end(); jt++) {
        P[*jt] -= D[i];
      }
    }
  }
  cout << ans.size() << endl;
  for (int i : ans) {
    cout << i << ' ';
  }
}
