#include <bits/stdc++.h>
using namespace std;
template <typename T>
T read() {
  T res;
  std::cin >> res;
  return res;
}
template <typename T>
void print(const T& t) {
  std::cout << t;
}
template <>
int read<int>() {
  int res;
  scanf("%d", &res);
  return res;
}
template <>
void print<int>(const int& t) {
  printf("%d", t);
};
template <>
unsigned int read<unsigned int>() {
  unsigned int res;
  scanf("%u", &res);
  return res;
}
template <>
void print<unsigned int>(const unsigned int& t) {
  printf("%u", t);
};
template <>
int64_t read<int64_t>() {
  int64_t res;
  scanf("%lld", &res);
  return res;
}
template <>
void print<int64_t>(const int64_t& t) {
  printf("%lld", t);
};
template <>
float read<float>() {
  float res;
  scanf("%f", &res);
  return res;
}
template <>
void print<float>(const float& t) {
  printf("%f", t);
};
template <>
double read<double>() {
  double res;
  scanf("%lf", &res);
  return res;
}
template <>
void print<double>(const double& t) {
  printf("%lf", t);
};
template <>
char read<char>() {
  char res;
  scanf("%c", &res);
  return res;
}
template <>
void print<char>(const char& t) {
  printf("%c", t);
};
template <typename T>
class Range {
 public:
  Range(T start, T end) : start_(std::min(start, end)), end_(end) {}
  class Iterator {
   public:
    Iterator(T pos) : pos_(pos) {}
    Iterator& operator++() {
      ++pos_;
      return *this;
    }
    const T& operator*() const { return pos_; }
    bool operator==(const Iterator& other) const { return pos_ == other.pos_; }
    bool operator!=(const Iterator& other) const { return !(*this == other); }

   private:
    T pos_;
  };
  Iterator begin() const { return {start_}; }
  Iterator end() const { return {end_}; }
  const T start_, end_;
};
template <typename T>
Range<T> range(T start, T end) {
  return {start, end};
}
template <typename T>
Range<T> range(T end) {
  return {0, end};
}
template <typename T>
void printVector(const std::vector<T>& out, std::string delimiter = " ") {
  if (out.empty()) return;
  for (size_t i = 0; i < out.size() - 1; ++i) std::cout << out[i] << delimiter;
  std::cout << out.back();
}
class Solver585A {
 public:
  void run();
};
void Solver585A::run() {
  int64_t n = read<int64_t>();
  struct Child {
    int64_t v, d, p;
  };
  vector<Child> childs(n);
  for (auto& c : childs) {
    c.v = read<int64_t>();
    c.d = read<int64_t>();
    c.p = read<int64_t>();
  }
  vector<int64_t> healed;
  for (int64_t i : range(n)) {
    if (childs[i].p < 0) continue;
    healed.push_back(i + 1);
    int64_t decreasingDebuff = childs[i].v;
    int64_t fixedDebuff = 0;
    for (int64_t j : range(i + 1, n)) {
      if (childs[j].p < 0) continue;
      auto& currChild = childs[j];
      currChild.p -= decreasingDebuff + fixedDebuff;
      if (currChild.p < 0) fixedDebuff += currChild.d;
      decreasingDebuff = max<int64_t>(0, decreasingDebuff - 1);
    }
  }
  print(healed.size());
  print('\n');
  printVector(healed);
}
using CurrentSolver = Solver585A;
int main() {
  CurrentSolver().run();
  return 0;
}
