#include <bits/stdc++.h>
using namespace std;
long long int ll_max(long long int a, long long int b, long long int c) {
  return max(a, max(b, c));
}
int int_max(int a, int b, int c) { return max(a, max(b, c)); }
long long int ll_min(long long int a, long long int b, long long int c) {
  return min(a, min(b, c));
}
int int_min(int a, int b, int c) { return min(a, min(b, c)); }
long long int max(int a, long long int b) { return max((long long int)a, b); }
long long int min(int a, long long int b) { return min((long long int)a, b); }
long long int min(long long int a, int b) { return min(a, (long long int)b); }
long long int max(long long int a, int b) { return max(a, (long long int)b); }
long long int dx[] = {0, 0, 1, -1};
long long int dy[] = {1, -1, 0, 0};
void err(istream_iterator<string> it) {}
template <typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
  cerr << ' ' << *it << " = " << a;
  err(++it, args...);
}
template <typename T, typename U>
inline void min_self(T& x, U y) {
  if (y < x) x = y;
}
template <typename T, typename U>
inline void max_self(T& x, U y) {
  if (x < y) x = y;
}
template <class T1, class T2>
ostream& operator<<(ostream& out, pair<T1, T2> pair) {
  return out << "(" << pair.first << ", " << pair.second << ")";
}
template <class T>
ostream& operator<<(ostream& out, vector<T> vec) {
  out << "(";
  for (auto& v : vec) out << v << ", ";
  return out << ")";
}
template <class T>
ostream& operator<<(ostream& out, set<T> vec) {
  out << "(";
  for (auto& v : vec) out << v << ", ";
  return out << ")";
}
template <class L, class R>
ostream& operator<<(ostream& out, map<L, R> vec) {
  out << "(";
  for (auto& v : vec) out << "[" << v.first << ", " << v.second << "]";
  return out << ")";
}
template <class A, class B>
istream& operator>>(istream& in, pair<A, B>& a) {
  return in >> a.first >> a.second;
}
template <class A>
istream& operator>>(istream& in, vector<A>& a) {
  for (A& i : a) in >> i;
  return in;
}
void solve() {
  long long int n;
  cin >> n;
  vector<long long int> v(n), d(n), p(n);
  for (long long int i = 0; i < n; i++) {
    cin >> v[i] >> d[i] >> p[i];
  }
  vector<long long int> ans, vis(n, 0);
  for (long long int i = 0; i < n; i++) {
    if (p[i] >= 0)
      ans.push_back(i + 1);
    else
      continue;
    long long int sum = 0;
    for (long long int j = i + 1; j < n; j++) {
      if (vis[j] > 0) continue;
      if (v[i] >= 0) p[j] -= v[i];
      p[j] -= sum;
      if (p[j] < 0) {
        sum += d[j];
        vis[j]++;
      }
      v[i]--;
    }
  }
  cout << ans.size() << '\n';
  for (auto i : ans) {
    cout << i << " ";
  }
  cout << '\n';
  return;
}
int main() {
  (ios::sync_with_stdio(false), cin.tie(0));
  long long int t = 1;
  while (t--) {
    solve();
  }
}
