#include <bits/stdc++.h>
using namespace std;
struct node {
  int s, d, c, index;
};
node p[105];
bool cmp(const node &a, const node &b) { return a.d < b.d; }
int tag[105];
int main(void) {
  int n, m, flag = 0;
  scanf("%d%d", &n, &m);
  for (int i = 0; i < m; i++) {
    scanf("%d%d%d", &p[i].s, &p[i].d, &p[i].c);
    p[i].index = i;
    if (tag[p[i].d] == 0)
      tag[p[i].d] = m + 1;
    else
      flag = 1;
  }
  if (flag == 1)
    printf("-1\n");
  else {
    sort(p, p + m, cmp);
    for (int i = 0; i < m; i++) {
      int num = 0;
      for (int j = p[i].s; j < p[i].d; j++) {
        if (tag[j] == 0) {
          tag[j] = p[i].index + 1;
          num++;
        }
        if (num == p[i].c) break;
      }
      if (num != p[i].c) {
        flag = 1;
        break;
      }
    }
    if (flag == 1)
      printf("-1\n");
    else {
      for (int i = 1; i <= n; i++) {
        printf("%d ", tag[i]);
      }
    }
  }
  return 0;
}
