#include <bits/stdc++.h>
using namespace std;
int const N = 109;
int n, m, s[N], d[N], c[N], ans[N];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  cin >> n >> m;
  for (int i = 1; i <= m; ++i) {
    cin >> s[i] >> d[i] >> c[i];
    ans[d[i]] = m + 1;
  }
  for (int i = 1; i <= n; ++i) {
    if (ans[i] == m + 1) continue;
    int t = 0, dist = N;
    for (int j = 1; j <= m; ++j) {
      if (i < d[j] && i >= s[j] && dist > (d[j] - i) && c[j] > 0) {
        dist = d[j] - i;
        t = j;
      }
    }
    ans[i] = t;
    c[t] -= 1;
  }
  bool test = false;
  for (int i = 1; i <= n; ++i) test |= (c[i] > 0);
  if (test) {
    cout << -1 << '\n';
  } else {
    for (int i = 1; i <= n; ++i) cout << ans[i] << ' ';
    cout << '\n';
  }
}
