#include <bits/stdc++.h>
using namespace std;
long long n, d[40005], v[4005], p[4005], cur, val, use[4005], cnt;
int main() {
  cin >> n;
  for (int i = 1; i <= n; ++i) cin >> v[i] >> d[i] >> p[i];
  for (int i = 1; i <= n; ++i)
    if (!use[i]) {
      cur = v[i];
      for (int j = i + 1; j <= n; ++j)
        if (!use[j]) {
          if (cur == 0) break;
          p[j] -= cur;
          cur--;
        }
      for (int j = i + 1; j <= n; ++j)
        if (p[j] < 0 && !use[j]) {
          use[j] = 1;
          val = d[j];
          for (int k = j + 1; k <= n; ++k)
            if (!use[k]) {
              p[k] -= val;
              if (p[k] < 0) {
                use[k] = 1;
                val += d[k];
              }
            }
          break;
        }
    }
  for (int i = 1; i <= n; ++i)
    if (p[i] >= 0) cnt++;
  cout << cnt << endl;
  for (int i = 1; i <= n; ++i)
    if (p[i] >= 0) cout << i << ' ';
}
