#include <bits/stdc++.h>
using namespace std;
using LL = long long;
constexpr int N = 4005;
int present[N];
int v[N], d[N], p[N];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> v[i] >> d[i] >> p[i];
  }
  for (int i = 1; i <= n; i++) {
    present[i] = 1;
  }
  vector<int> ans;
  for (int i = 1; i <= n; i++) {
    if (!present[i]) continue;
    ans.push_back(i);
    queue<int> Q;
    for (int j = i + 1; j <= n; j++) {
      if (!present[j]) continue;
      p[j] -= v[i];
      if (p[j] < 0) {
        Q.push(j);
        present[j] = 0;
      }
      v[i]--;
      if (v[i] == 0) break;
    }
    while (!Q.empty()) {
      int x = Q.front();
      Q.pop();
      for (int j = x + 1; j <= n; j++) {
        if (!present[j]) continue;
        p[j] -= d[x];
        if (p[j] < 0) {
          Q.push(j);
          present[j] = 0;
        }
      }
    }
  }
  cout << ans.size() << "\n";
  for (int x : ans) cout << x << ' ';
}
