#include <bits/stdc++.h>
using namespace std;
int n, m, ans[11234];
struct input {
  int s, d, c, id;
} a[105];
int comp(input left, input right) { return left.d < right.d; }
int main() {
  cin >> n >> m;
  for (int i = 1; i <= m; ++i) {
    cin >> a[i].s >> a[i].d >> a[i].c;
    ans[a[i].d] = m + 1;
    a[i].id = i;
  }
  sort(a + 1, a + m + 1, comp);
  for (int i = 1; i <= m; ++i) {
    for (int j = a[i].s; j < a[i].d && a[i].c; ++j) {
      if (!ans[j]) {
        ans[j] = a[i].id;
        a[i].c--;
      }
    }
    if (a[i].c) {
      cout << -1 << endl;
      return 0;
    }
  }
  for (int i = 1; i <= n; ++i) {
    cout << ans[i] << " ";
  }
  cout << endl;
  return 0;
}
