#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e3 + 7;
struct node {
  int s, d, c, id;
} a[maxn];
int vis[maxn];
bool cmp(node a, node b) { return a.d < b.d; }
int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  for (int i = 1; i <= m; i++) {
    scanf("%d %d %d", &a[i].s, &a[i].d, &a[i].c);
    vis[a[i].d] = m + 1;
    a[i].id = i;
  }
  sort(a + 1, a + 1 + m, cmp);
  for (int i = 1; i <= m; i++) {
    int cnt = 0;
    for (int j = a[i].s; j < a[i].d; j++) {
      if (!vis[j]) {
        cnt++;
        vis[j] = a[i].id;
        if (cnt == a[i].c) break;
      }
    }
    if (cnt != a[i].c) {
      puts("-1");
      return 0;
    }
  }
  for (int i = 1; i <= n; i++) printf(i == n ? "%d\n" : "%d ", vis[i]);
  return 0;
}
