#include <bits/stdc++.h>
using namespace std;
struct exam {
  int s, d, c, idx;
} a[102];
int ans[102];
bool cmp(exam a, exam b) { return a.d < b.d; }
int main() {
  int n, m;
  cin >> m >> n;
  for (int i = 1; i <= m; i++) {
    ans[i] = 0;
  }
  for (int i = 1; i <= n; i++) {
    cin >> a[i].s >> a[i].d >> a[i].c;
    a[i].idx = i;
    ans[a[i].d] = n + 1;
  }
  sort(a + 1, a + 1 + n, cmp);
  for (int i = 1; i <= n; i++) {
    for (int j = a[i].s; j <= a[i].d; j++) {
      if (ans[j] == 0 && a[i].c) {
        ans[j] = a[i].idx;
        a[i].c--;
      }
    }
    if (a[i].c) {
      cout << -1;
      return 0;
    }
  }
  for (int i = 1; i <= m; i++) {
    cout << ans[i] << " ";
  }
  return 0;
}
