#include <bits/stdc++.h>
using namespace std;
void err(istream_iterator<string> it) {}
template <typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
  cerr << *it << " = " << a << "\n";
  err(++it, args...);
}
int vis[100005];
int main() {
  int n, m, i, j, a, b, c, f;
  scanf("%d%d", &n, &m);
  vector<pair<pair<int, int>, int> > vp(m);
  for (i = 0; i < m; i++) {
    scanf("%d%d%d", &a, &b, &c);
    vp[i] = {{a, b}, c};
    vis[b] = i + 1;
  }
  set<pair<int, int> > st;
  pair<int, int> temp;
  set<pair<int, int> >::iterator itr;
  sort(vp.begin(), vp.end());
  vector<int> v(n + 1, 0);
  j = 0, f = 1;
  for (i = 1; i < n + 1; i++) {
    while (j < m && vp[j].first.first == i)
      st.insert({vp[j].first.second, vp[j].second}), j++;
    if (vis[i])
      v[i] = m + 1;
    else if (st.size() == 0)
      continue;
    else {
      itr = st.begin();
      st.erase(itr);
      temp = (*itr);
      b = temp.first, c = temp.second;
      if (b < i)
        f = 0;
      else {
        v[i] = vis[b];
        if (c > 1) st.insert({b, c - 1});
      }
    }
  }
  if (st.size() > 0) f = 0;
  if (f) {
    for (i = 1; i < n + 1; i++) printf("%d ", v[i]);
  }
  if (!f) printf("%d\n", -1);
}
