#include <bits/stdc++.h>
using namespace std;
const int INF = INT_MAX;
const long long INFL = LLONG_MAX;
int dx[] = {1, -1, 0, 0};
int dy[] = {0, 0, 1, -1};
int v[4100], d[4100], p[4100];
int e[4100];
int main() {
  ios_base::sync_with_stdio(0);
  cout.precision(15);
  cout << fixed;
  cout.tie(0);
  cin.tie(0);
  int n;
  cin >> n;
  for (int(i) = 0; (i) < (n); (i)++) cin >> v[i] >> d[i] >> p[i];
  memset(e, 0, sizeof(e));
  ;
  int ans = 0;
  for (int(i) = 0; (i) < (n); (i)++)
    if (p[i] >= 0) {
      for (int j = i + 1; j < n && v[i] > 0; j++)
        if (p[j] >= 0) {
          p[j] -= v[i];
          v[i]--;
        }
      for (int j = i + 1; j < n; j++)
        if (p[j] < 0 && !e[j]) {
          e[j] = 1;
          for (int k = j + 1; k < n; k++)
            if (p[k] >= 0) p[k] -= d[j];
        }
      ans++;
    }
  cout << ans << '\n';
  for (int(i) = 0; (i) < (n); (i)++)
    if (p[i] >= 0) cout << i + 1 << " ";
  cout << '\n';
}
