#include <bits/stdc++.h>
using namespace std;
struct Exam {
  int s, d, c, id;
  bool operator<(const Exam &e1) const { return d < e1.d; }
};
const int N = 105;
int n, m, to[N];
Exam e[N];
int main() {
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    cin >> e[i].s >> e[i].d >> e[i].c;
    e[i].id = i;
    to[e[i].d] = m + 1;
  }
  sort(e + 1, e + m + 1);
  for (int i = 1; i <= m; i++) {
    int cnt = 0;
    for (int j = e[i].s; j < e[i].d; j++) {
      if (to[j] == 0) {
        to[j] = e[i].id;
        if (++cnt == e[i].c) break;
      }
    }
    if (cnt < e[i].c) {
      cout << -1 << endl;
      return 0;
    }
  }
  for (int i = 1; i <= n; i++) cout << to[i] << " ";
  cout << endl;
  return 0;
}
