#include <bits/stdc++.h>
using namespace std;
int n, m, ans[105];
struct chj {
  int L, R, s, id;
  bool operator<(const chj b) const { return R < b.R || (R == b.R && L < b.L); }
} a[105];
inline int read() {
  int ret = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') ret = ret * 10 + ch - '0', ch = getchar();
  return ret * f;
}
int main() {
  n = read();
  m = read();
  for (int i = 1; i <= m; i++) a[i] = (chj){read(), read(), read(), i};
  sort(a + 1, a + m + 1);
  for (int i = 1; i <= m; i++) {
    for (int j = a[i].L; j < a[i].R; j++)
      if (!ans[j]) {
        ans[j] = a[i].id;
        a[i].s--;
        if (a[i].s == 0) break;
      }
    if (a[i].s != 0) {
      printf("-1");
      return 0;
    }
    if (ans[a[i].R] != 0) {
      printf("-1");
      return 0;
    }
    ans[a[i].R] = m + 1;
  }
  for (int i = 1; i < n; i++) printf("%d ", ans[i]);
  printf("%d\n", ans[n]);
  return 0;
}
