#include <bits/stdc++.h>
using namespace std;
struct node {
  int s, d, c, id;
} data[105];
int n, m, ans[105];
bool cmp(node a, node b) { return a.d < b.d; }
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= m; i++) {
    scanf("%d%d%d", &data[i].s, &data[i].d, &data[i].c);
    data[i].id = i;
    ans[data[i].d] = m + 1;
  }
  sort(data + 1, data + 1 + m, cmp);
  bool f = false;
  for (int i = 1; i <= m; i++) {
    int t = data[i].s;
    while (data[i].c--) {
      while (ans[t]) t++;
      if (t >= data[i].d) {
        f = true;
        break;
      }
      ans[t] = data[i].id;
    }
    if (f) break;
  }
  if (f)
    puts("-1");
  else {
    for (int i = 1; i <= n; i++) printf("%d ", ans[i]);
    puts("");
  }
  return 0;
}
