#include <bits/stdc++.h>
using namespace std;
vector<int> ans;
void update(vector<vector<int> >& data, vector<bool>& there, int p, int f) {
  int temp = data[f][p];
  if (f == 0) {
    int counter = temp;
    vector<int> imp;
    for (int j = p + 1; (j < data[0].size() && counter > 0); j++) {
      if (there[j] == true) {
        data[2][j] -= temp;
        temp--;
        if (data[2][j] < 0) {
          there[j] = false;
          imp.push_back(j);
        }
        counter--;
      }
    }
    for (int i = 0; i < imp.size(); ++i) {
      update(data, there, imp[i], 1);
    }
  } else {
    if (temp > 0) {
      for (int j = p + 1; j < data[0].size(); j++) {
        if (there[j] == true) {
          data[2][j] -= temp;
          if (data[2][j] < 0) {
            there[j] = false;
            update(data, there, j, 1);
          }
        }
      }
    }
  }
}
int main() {
  int n;
  cin >> n;
  vector<vector<int> > data;
  data.resize(3);
  data[0].resize(n);
  data[1].resize(n);
  data[2].resize(n);
  vector<bool> there(n);
  for (int i = 0; i < data[0].size(); ++i) {
    cin >> data[0][i] >> data[1][i] >> data[2][i];
    if (data[2][i] >= 0)
      there[i] = true;
    else
      there[i] = false;
  }
  for (int i = 0; i < data[0].size(); ++i) {
    if (there[i] == true) {
      ans.push_back(i + 1);
      update(data, there, i, 0);
    }
  }
  cout << ans.size() << endl;
  for (int i = 0; i < ans.size(); ++i) {
    cout << ans[i] << " ";
  }
  cout << endl;
}
