#include <bits/stdc++.h>
using namespace std;
const int N = 100 + 5;
struct exam {
  int b;
  int s;
  int d;
  int c;
} e[N];
bool cmp(exam& a, exam& b) { return a.d < b.d; }
int ans[N];
int main(void) {
  int n, m;
  memset(ans, 0, sizeof(ans));
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= m; i++) {
    scanf("%d%d%d", &e[i].s, &e[i].d, &e[i].c);
    e[i].b = i;
  }
  sort(e + 1, e + m + 1, cmp);
  int ok = 1;
  for (int i = 1; i <= m; i++) {
    if (ok) {
      for (int j = e[i].s;; j++) {
        if (j == e[i].d && e[i].c != 0) {
          ok = 0;
          printf("-1");
          break;
        }
        if (e[i].c == 0) {
          ans[e[i].d] = m + 1;
          break;
        }
        if (ans[j] == 0) {
          ans[j] = e[i].b;
          e[i].c--;
        }
      }
    }
  }
  if (ok) {
    for (int i = 1; i <= n; i++) {
      printf("%d", ans[i]);
      if (i != n) {
        printf(" ");
      }
    }
  }
  return 0;
}
