#include <bits/stdc++.h>
using namespace std;
vector<pair<pair<long long int, long long int>,
            pair<long long int, long long int>>>
    v;
int main() {
  long long int t = 1, n, m, i, j, k, sum = 0, ans = 0;
  cin >> n >> m;
  long long int s[m], d[m], c[m], a[n + 1];
  for (i = 1; i <= n; i++) a[i] = 0;
  for (i = 0; i < m; i++) {
    cin >> s[i] >> d[i] >> c[i];
    v.push_back(make_pair(make_pair(s[i], d[i]), make_pair(c[i], i + 1)));
    a[d[i]] = m + 1;
  }
  sort(v.begin(), v.end());
  priority_queue<pair<pair<long long int, long long int>,
                      pair<long long int, long long int>>,
                 vector<pair<pair<long long int, long long int>,
                             pair<long long int, long long int>>>,
                 greater<pair<pair<long long int, long long int>,
                              pair<long long int, long long int>>>>
      pq;
  j = 0;
  for (i = 1; i <= n; i++) {
    while (j < m && v[j].first.first == i) {
      pq.push(make_pair(make_pair(v[j].first.second, v[j].second.first),
                        make_pair(v[j].first.first, v[j].second.second)));
      j++;
    }
    if (a[i]) continue;
    if (pq.size()) {
      pair<pair<long long int, long long int>,
           pair<long long int, long long int>>
          p = pq.top();
      pq.pop();
      if (p.first.first <= i) {
        cout << "-1";
        return 0;
      }
      a[i] = p.second.second;
      p.first.second--;
      if (p.first.second) {
        pq.push(p);
      }
    }
  }
  if (pq.size()) {
    cout << "-1";
    return 0;
  }
  for (i = 1; i <= n; i++) cout << a[i] << " ";
  return 0;
}
