#include <bits/stdc++.h>
using namespace std;
int s[105], d[105], c[105];
int ans[105] = {0};
vector<pair<int, int>> v;
int main() {
  int tc;
  tc = 1;
  while (tc--) {
    int n, m;
    cin >> n >> m;
    int flag = 1;
    for (int i = 1; i <= m; i++) {
      cin >> s[i] >> d[i] >> c[i];
      if (d[i] - s[i] < c[i]) flag = 0;
      ans[d[i]] = m + 1;
      v.push_back({i, d[i]});
    }
    if (flag == 0) {
      cout << -1 << "\n";
      continue;
    }
    sort(v.begin(), v.end(), [](pair<int, int> &a, pair<int, int> &b) {
      return a.second < b.second;
    });
    flag = 1;
    for (int i = 0; i < m; i++) {
      int now = v[i].first;
      int cnt = 0;
      for (int j = s[now]; j < d[now] and cnt < c[now]; j++) {
        if (ans[j] == 0) {
          ans[j] = now;
          cnt++;
        }
      }
      if (cnt < c[now]) {
        flag = 0;
        break;
      }
    }
    if (flag == 0)
      cout << -1 << "\n";
    else {
      for (int i = 1; i <= n; i++) cout << ans[i] << " ";
      cout << "\n";
    }
  }
  return 0;
}
