#include <bits/stdc++.h>
using namespace std;
struct exam {
  int s, d, c, idx;
};
int main() {
  ios_base::sync_with_stdio(0);
  int n, m, x, y, z;
  cin >> n >> m;
  vector<int> ans(n + 1, 0);
  vector<exam> v(m);
  for (int i = 0; i < m; i++) {
    cin >> v[i].s >> v[i].d >> v[i].c;
    v[i].idx = i + 1;
    ans[v[i].d] = m + 1;
  }
  sort(v.begin(), v.end(), [&](exam& e1, exam& e2) { return e1.d < e2.d; });
  for (int i = 0; i < m; i++) {
    for (int j = v[i].s; j < v[i].d && v[i].c; j++) {
      if (!ans[j]) {
        ans[j] = v[i].idx;
        v[i].c--;
      }
    }
    if (v[i].c) {
      cout << -1 << endl;
      return 0;
    }
  }
  for (int i = 1; i <= n; i++) cout << ans[i] << " ";
  cout << endl;
  return 0;
}
