#include <bits/stdc++.h>
using namespace std;
int ans[1000009];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, m;
  cin >> n >> m;
  vector<pair<pair<int, int>, pair<int, int> > > v;
  int x, y, z, a;
  for (int i = 0; i < m; ++i) {
    cin >> x >> y >> z;
    v.push_back({{y, i}, {x, z}});
    ans[y] = m + 1;
  }
  sort(v.begin(), v.end());
  for (int i = 0; i < m; ++i) {
    y = v[i].first.first;
    a = v[i].first.second;
    x = v[i].second.first;
    z = v[i].second.second;
    for (int j = x; j < y && z > 0; ++j) {
      if (ans[j] == 0) {
        ans[j] = a + 1;
        --z;
      }
    }
    if (z > 0) {
      cout << -1;
      return 0;
    }
  }
  for (int i = 1; i <= n; ++i) cout << ans[i] << " ";
}
