#include <bits/stdc++.h>
using namespace std;
class C_ {};
template <typename T>
C_& operator<<(C_& __m, const T& __s) {
  if (!1) cerr << "\E[91m" << __s << "\E[0m";
  return __m;
}
C_ merr;
struct __s {
  __s() {
    if (1) {
      ios_base::Init i;
      cin.sync_with_stdio(0);
      cin.tie(0);
    }
  }
  ~__s() {
    merr << "Execution time: " << (double)clock() / CLOCKS_PER_SEC << " s.\n";
  }
} __S;
long long V[4444], D[4444], P[4444];
int n;
bool u[4444];
int cry_in(int idx) {
  int res = -1;
  int down = 0;
  for (int i = idx + 1; i < n; i++) {
    if (u[i]) continue;
    P[i] -= max(0LL, V[idx] - (down));
    down++;
    if (P[i] < 0 && res == -1) res = i;
  }
  return res;
}
int cry_out(int idx) {
  int res = 1000000;
  for (int i = idx + 1; i < n; i++) {
    if (u[i]) continue;
    P[i] -= D[idx];
    if (P[i] < 0) res = min(res, i);
  }
  if (res >= 1000000) res = -1;
  return res;
}
int check_out(int from) {
  int res = 0;
  for (int i = from; i < n; i++) {
    if (!u[i]) {
      if (P[i] < 0) {
        u[i] = 1;
        res = 1;
        cry_out(i);
      }
    }
  }
  return res;
}
int main(void) {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> V[i] >> D[i] >> P[i];
  }
  vector<int> R;
  for (int i = 0; i < n; i++) {
    if (u[i]) continue;
    R.push_back(i);
    u[i] = 1;
    cry_in(i);
    while (check_out(i + 1))
      ;
  }
  cout << R.size() << '\n';
  for (int i = 0; i < (int)R.size(); i++) {
    cout << R[i] + 1 << " ";
  }
  cout << '\n';
  return 0;
}
