#include <bits/stdc++.h>
using namespace std;
struct exam {
  int s;
  int d;
  int c;
  int num;
};
bool operator<(exam l, exam r) {
  if (l.d < r.d) return true;
  if (l.d > r.d) return false;
  if (l.s < r.s) return true;
  if (l.s > r.s) return false;
  return l.c < r.c;
}
int main() {
  int n, m;
  cin >> n >> m;
  vector<exam> v(m);
  vector<int> a(n);
  bool ans = true;
  for (int i = 0; i < m; i++) {
    cin >> v[i].s >> v[i].d >> v[i].c;
    v[i].num = i + 1;
  }
  sort(v.begin(), v.end());
  for (int i = 0; i < m; i++) {
    a[v[i].d - 1] = m + 1;
  }
  for (int i = 0; i < m; i++) {
    if (!ans) break;
    int count = 0, j = v[i].s - 1;
    while (count < v[i].c) {
      if (j == v[i].d - 1) {
        ans = false;
        break;
      }
      if (a[j] == 0) {
        count++;
        a[j] = v[i].num;
      }
      j++;
    }
  }
  if (ans) {
    for (int i = 0; i < n; i++) {
      cout << a[i] << ' ';
    }
  } else {
    cout << "-1";
  }
}
