#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, m;
  cin >> n >> m;
  int s[m], d[m], c[m];
  for (int i = 0; i < m; i++) cin >> s[i] >> d[i] >> c[i];
  vector<int> ans(101, 0);
  for (int i = 0; i < m; i++) {
    ans[d[i]] = m + 1;
    if (c[i] > d[i] - s[i]) {
      cout << -1 << endl;
      return 0;
    }
  }
  vector<pair<int, int> > v;
  for (int i = 0; i < m; i++) {
    v.push_back({d[i], i});
  }
  sort(v.begin(), v.end());
  for (int i = 0; i < m; i++) {
    int x = v[i].second;
    int left = c[x];
    for (int j = s[x]; j < d[x]; j++) {
      if (left > 0 && ans[j] == 0) {
        ans[j] = x + 1;
        left--;
      }
    }
    if (left > 0) {
      cout << -1 << endl;
      return 0;
    }
  }
  for (int i = 1; i <= n; i++) cout << ans[i] << " ";
  return 0;
}
