#include <bits/stdc++.h>
using namespace std;
struct thi {
  int s, d, c, tt;
};
int d[101], n, m;
thi b[101];
bool ss(thi tr, thi s) { return tr.d < s.d; }
int main() {
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    cin >> b[i].s >> b[i].d >> b[i].c;
    b[i].tt = i;
  }
  sort(b + 1, b + m + 1, ss);
  int cs, kt = 1;
  for (int i = 1; i <= m; i++) {
    d[b[i].d] = m + 1;
    cs = b[i].s;
    while (cs < b[i].d && b[i].c) {
      if (d[cs] == 0) d[cs] = b[i].tt, b[i].c--;
      cs++;
    }
    if (b[i].c) {
      kt = 0;
      break;
    }
  }
  if (kt)
    for (int i = 1; i <= n; i++) cout << d[i] << " ";
  else
    cout << -1;
}
