#include <bits/stdc++.h>
using namespace std;
long long n, m, ans[1000004], p[1000004], prothesmia[1000004];
pair<long long, long long> d[1000004], s[1000004];
bool can = true;
void solve() {
  priority_queue<pair<long long, long long> > pq;
  long long nextexam = 1;
  long long nextproblem = 1;
  for (int day = 1; day < n + 1; day++) {
    while (nextproblem <= m && s[nextproblem].first == day) {
      pq.push(
          make_pair(-prothesmia[s[nextproblem].second], s[nextproblem].second));
      nextproblem++;
    }
    if (d[nextexam].first == day) {
      if (p[d[nextexam].second] != 0) can = false;
      ans[day] = m + 1;
      nextexam++;
      continue;
    }
    if (pq.empty()) {
      ans[day] = 0;
      continue;
    }
    ans[day] = pq.top().second;
    p[pq.top().second]--;
    if (p[pq.top().second] == 0) {
      pq.pop();
    }
  }
  return;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n >> m;
  for (int i = 1; i < m + 1; i++) {
    cin >> s[i].first >> d[i].first >> p[i];
    s[i].second = d[i].second = i;
    prothesmia[i] = d[i].first;
  }
  sort(s + 1, s + m + 1);
  sort(d + 1, d + m + 1);
  solve();
  if (!can) {
    cout << -1;
    return 0;
  }
  for (int i = 1; i < n + 1; i++) {
    cout << ans[i] << " ";
  }
  return 0;
}
