#include <bits/stdc++.h>
using namespace std;
const long long Maxn = 4005;
const long long Mod = 1000000007;
inline void fastIO() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
}
long long v[Maxn], d[Maxn], p[Maxn];
int main() {
  fastIO();
  long long n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> v[i] >> d[i] >> p[i];
  }
  vector<int> ans;
  ans.clear();
  for (int i = 0; i < n; i++) {
    if (p[i] >= 0) {
      ans.push_back(i + 1);
      long long temp1 = 0, temp2 = 0, c = 0;
      for (int j = i + 1; j < n; j++) {
        if (p[j] >= 0) {
          temp1 = max(v[i] - c, 0LL);
          c++;
          p[j] = p[j] - temp1 - temp2;
          if (p[j] < 0) {
            temp2 += d[j];
          }
        }
      }
    }
  }
  int sz = ans.size();
  cout << sz << endl;
  for (int i = 0; i < sz; i++) {
    cout << ans[i] << " ";
  }
  cout << endl;
  return 0;
}
