#include <bits/stdc++.h>
struct fak {
  int s, d, c, index;
};
bool compare(const fak &x, const fak &y) {
  if (x.d < y.d)
    return 1;
  else
    return 0;
}
int main() {
  int n, m, day[110] = {0}, exam[120] = {0};
  std::cin >> n >> m;
  fak exams[110];
  for (int i = 0; i < m; ++i) {
    std::cin >> exams[i].s >> exams[i].d >> exams[i].c;
    exams[i].index = i;
    if (exams[i].d - exams[i].s < exams[i].c) {
      std::cout << -1;
      return 0;
    }
  }
  std::sort(exams, exams + m, compare);
  for (int i = 0; i < m; ++i) {
    day[exams[i].d] = m + 1;
    for (int j = exams[i].s; j <= exams[i].d && exams[i].c > 0; ++j) {
      if (day[j] == 0) {
        day[j] = exams[i].index + 1;
        --exams[i].c;
      }
    }
    if (exams[i].c > 0) {
      std::cout << -1;
      return 0;
    }
  }
  for (int i = 1; i <= n; ++i) {
    std::cout << day[i] << " ";
  }
}
