#include <bits/stdc++.h>
using namespace std;
void snum(long long &x) { scanf("%lld", &x); }
void snum(long long &x, long long &y) { scanf("%lld %lld", &x, &y); }
void snum(long long &x, long long &y, long long &z) {
  scanf("%lld %lld %lld", &x, &y, &z);
}
const long long MAX = 110;
struct Exam {
  long long s, d, c, acum, ind;
  Exam() { acum = 0; }
  bool operator<(const Exam &P) const { return d > P.d; }
} E[MAX];
void doit() {
  priority_queue<Exam> q;
  long long n, m;
  snum(n, m);
  for (long long i = 0; i < (long long)m; i++) {
    snum(E[i].s, E[i].d, E[i].c);
    E[i].ind = i + 1;
  }
  vector<long long> resp;
  for (long long day = 1; day <= n; day++) {
    bool ex = false;
    for (long long i = 0; i < (long long)n; i++) {
      if (E[i].d == day) {
        if (E[i].acum < E[i].c) {
          printf("-1\n");
          return;
        }
        resp.push_back(m + 1);
        ex = true;
      }
      if (E[i].s == day) {
        q.push(E[i]);
      }
    }
    if (!ex) {
      if (q.empty()) {
        resp.push_back(0);
      } else {
        Exam exa = q.top();
        q.pop();
        exa.acum++;
        resp.push_back(exa.ind);
        E[exa.ind - 1].acum = exa.acum;
        if (exa.c != exa.acum) {
          q.push(exa);
        }
      }
    }
  }
  for (long long i = 0; i < (long long)resp.size(); i++) {
    printf("%lld ", resp[i]);
  }
}
int main() {
  long long T = 1;
  while (T--) {
    doit();
  }
  return 0;
}
