#include <bits/stdc++.h>
using namespace std;
long long n, m, i, j, k, mn, a[100009], c[100009], d[100009], s[100009];
int main() {
  cin >> n >> m;
  for (i = 1; i <= m; i++) {
    cin >> s[i] >> d[i] >> c[i];
    a[d[i]] = m + 1;
  }
  for (i = 1; i <= n; i++)
    if (!a[i]) {
      mn = 1000000009;
      for (j = 1; j <= m; j++)
        if (s[j] <= i && d[j] > i && c[j] && d[j] < mn) {
          k = j;
          mn = d[j];
        }
      if (mn != 1000000009) {
        c[k]--;
        a[i] = k;
      }
    }
  for (i = 1; i <= m; i++)
    if (c[i]) {
      cout << -1;
      return 0;
    }
  for (i = 1; i <= n; i++) cout << a[i] << ' ';
}
