#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, m;
  cin >> n >> m;
  int a[n + 1];
  for (int i = 1; i <= n; i++) a[i] = -1;
  int f = 0;
  pair<int, pair<int, pair<int, int> > > b[m];
  for (int i = 0; i < m; i++) {
    int x, y, z;
    cin >> x >> y >> z;
    b[i] = make_pair(y, make_pair(x, make_pair(z, i + 1)));
  }
  sort(b, b + m);
  for (int i = 0; i < m; i++) {
    int s, d, c;
    s = b[i].second.first;
    d = b[i].first;
    c = b[i].second.second.first;
    int pos = b[i].second.second.second;
    a[d] = m + 1;
    int p = s;
    while (p < d && c > 0) {
      if (a[p] == -1) {
        a[p] = pos;
        p++;
        c--;
      } else {
        p++;
      }
    }
    if (c > 0) {
      f = 1;
    }
  }
  if (f == 1)
    cout << "-1";
  else {
    for (int i = 1; i <= n; i++) {
      if (a[i] == -1)
        cout << "0 ";
      else
        cout << a[i] << " ";
    }
  }
  return 0;
}
