#include <bits/stdc++.h>
using namespace std;
int book[108];
struct node {
  int s;
  int d;
  int c;
  int id;
} a[108];
bool cmp(node x, node y) { return x.d < y.d; }
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    cin >> a[i].s >> a[i].d >> a[i].c;
    book[a[i].d] = m + 1;
    a[i].id = i;
  }
  sort(a + 1, a + m + 1, cmp);
  int sum = 0, flag = 0, zgq = 0;
  for (int i = 1; i <= m; i++) {
    sum = 0;
    flag = 0;
    for (int j = a[i].s; j <= a[i].d; j++) {
      if (!book[j]) {
        sum++;
        book[j] = a[i].id;
      }
      if (sum == a[i].c) {
        flag = 1;
        break;
      }
    }
    if (!flag) {
      zgq = 1;
      break;
    }
  }
  if (zgq) {
    cout << -1;
  } else {
    for (int i = 1; i <= n; i++) {
      cout << book[i] << " ";
    }
  }
  cout << endl;
}
