#include <bits/stdc++.h>
using namespace std;
long long a[1000000];
bool f[1000000];
int main() {
  long long n, x, y, z, m = 0, c = 0, M = 0;
  cin >> n;
  pair<pair<long long, long long>, long long> b[n];
  for (int i = 0; i < n; i++)
    cin >> b[i].first.first >> b[i].first.second >> b[i].second;
  for (int i = 0; i < n; i++) {
    M = 0;
    if (b[i].second >= 0) {
      a[c] = i + 1;
      c++;
      m = b[i].first.first;
    } else
      continue;
    for (int j = i + 1; j < n; j++) {
      if (b[j].second - (m + M) < 0) {
        if (b[j].second >= 0) {
          b[j].second -= (m + M);
          if (m > 0)
            m--;
          else
            m = 0;
        }
        if (!f[j]) {
          M += b[j].first.second;
          f[j] = 1;
        }
        continue;
      }
      b[j].second -= (m + M);
      if (b[i].second >= 0 && m > 0) m--;
      if (m < 0) m = 0;
    }
  }
  cout << c << endl;
  for (int i = 0; i < c; i++) cout << a[i] << " ";
}
