#include <bits/stdc++.h>
using namespace std;
vector<pair<int, int> > x;
vector<int> y, ok;
map<pair<int, int>, int> mp;
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  x.resize(m);
  y.resize(m);
  ok.resize(n + 1);
  for (int i = 0; i < m; i++) {
    scanf("%d%d%d", &x[i].second, &x[i].first, &y[i]);
    mp[make_pair(x[i].first, x[i].second)] = i;
  }
  sort(x.begin(), x.end());
  for (int i = 0; i < m; i++) ok[x[i].first] = m + 1;
  for (int i = 0; i < m; i++) {
    int l = x[i].second, r = x[i].first,
        indx = mp[make_pair(x[i].first, x[i].second)];
    int cnt = 0;
    for (int i2 = l; i2 <= r - 1; i2++) {
      if (!ok[i2]) {
        ok[i2] = indx + 1;
        cnt++;
      }
      if (cnt >= y[indx]) {
        cnt -= (cnt > y[indx]);
        break;
      }
    }
    if (cnt != y[indx]) return printf("-1"), 0;
  }
  for (int i = 1; i <= n; i++) printf("%d ", ok[i]);
  return 0;
}
