#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n, m;
  cin >> n >> m;
  vector<pair<int, pair<int, pair<int, int> > > > v;
  vector<long long int> a(n + 1, 0);
  for (int i = 0; i < m; i++) {
    int s, d, c;
    cin >> s >> d >> c;
    v.push_back({d, {s, {c, i + 1}}});
    if (a[d] != 0) {
      cout << "-1\n";
      exit(0);
    }
    a[d] = m + 1;
  }
  sort((v).begin(), (v).end());
  for (int i = 0; i < m; i++) {
    long long cnt = 0;
    for (long long j = v[i].second.first; j < v[i].first; j++) {
      if (a[j] == 0) {
        a[j] = v[i].second.second.second;
        cnt++;
      }
      if (cnt == v[i].second.second.first) break;
    }
    if (cnt < v[i].second.second.first) {
      cout << "-1\n";
      exit(0);
    }
  }
  for (int i = 1; i < n + 1; i++) {
    cout << a[i] << " ";
  }
  cout << '\n';
  return 0;
}
