#include <bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/stck:1024000000,1024000000")
struct node {
  int s, d, c, id;
  bool operator<(const node &a) const { return a.d > d; }
} e[106];
int vis[106], b[106];
int n, m;
int main() {
  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].id = i;
  }
  sort(e + 1, e + m + 1);
  memset(vis, 0, sizeof(vis));
  memset(b, 0, sizeof(b));
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      if (e[j].d == i) {
        if (vis[j] < e[j].c) {
          printf("-1\n");
          return 0;
        } else
          b[i] = m + 1;
        break;
      }
    }
    if (b[i]) continue;
    for (int j = 1; j <= m; j++) {
      if (i >= e[j].s && vis[j] < e[j].c) {
        b[i] = e[j].id;
        vis[j]++;
        break;
      }
    }
  }
  for (int i = 1; i <= n; i++) printf("%d ", b[i]);
  return 0;
}
