#include <bits/stdc++.h>
using namespace std;
long long cry_doc[10666], confidence[10666], cry_hall[10666];
bool just_left[10666];
vector<int> result;
int main() {
  long long n, i, j;
  cin >> n;
  for (i = 1; i <= n; ++i) cin >> cry_doc[i] >> cry_hall[i] >> confidence[i];
  for (i = 1; i <= n; ++i)
    if (just_left[i] == false) {
      result.push_back(i);
      long long v = 0;
      for (j = i + 1; j <= n; ++j)
        if (just_left[j] == false) {
          confidence[j] -= max((long long)0, cry_doc[i] - v);
          ++v;
        }
      just_left[i] = true;
      while (true) {
        bool okz = false;
        int pos = 0;
        for (j = 1; j <= n; ++j)
          if (confidence[j] < 0 && just_left[j] == false) {
            okz = true, pos = j;
            break;
          }
        if (okz == false) break;
        just_left[pos] = true;
        for (j = pos; j <= n; ++j) confidence[j] -= cry_hall[pos];
      }
    }
  int N = result.size();
  cout << N << '\n';
  for (i = 0; i < N; ++i) cout << result[i] << " ";
  return 0;
}
