#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
struct att {
  int v, d, p;
};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  vector<int> v(n), d(n);
  vector<long long int> p(n);
  for (int i = 0; i < n; i++) cin >> v[i] >> d[i] >> p[i];
  vector<bool> vis(n, true);
  for (int i = 0; i < n; i++) {
    if (vis[i]) {
      for (int j = i + 1; j < n && v[i] > 0; j++)
        if (vis[j]) {
          p[j] -= v[i];
          v[i]--;
        }
      long long int res = 0LL;
      for (int j = i + 1; j < n; j++)
        if (vis[j]) {
          p[j] -= res;
          if (p[j] < 0) {
            res += d[j];
            vis[j] = false;
          }
        }
    }
  }
  int cnt = 0;
  for (bool x : vis)
    if (x) cnt++;
  cout << cnt << "\n";
  for (int i = 0; i < n; i++)
    if (vis[i]) cout << i + 1 << " ";
}
