#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
void DBG() { cerr << "]" << endl; }
template <class H, class... T>
void DBG(H h, T... t) {
  cerr << to_string(h);
  if (sizeof...(t)) cerr << ", ";
  DBG(t...);
}
int main(void) {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  cerr.tie(nullptr);
  int n;
  cin >> n;
  vector<vector<long long>> a(n, vector<long long>(3));
  for (int i = 0; i < n; ++i) {
    cin >> a[i][0] >> a[i][1] >> a[i][2];
  }
  vector<bool> vis(n);
  vector<int> ans;
  for (int i = 0; i < n; ++i) {
    long long bonus = 0;
    if (a[i][2] < 0) continue;
    ans.push_back(i + 1);
    for (int j = i + 1; j < n; ++j) {
      if (a[j][2] < 0) continue;
      a[j][2] -= (max(0LL, a[i][0]) + bonus);
      --a[i][0];
      if (a[j][2] < 0) bonus += a[j][1];
    }
  }
  cout << ((int)(ans).size()) << "\n";
  for (auto &A : ans) cout << A << ' ';
}
