#include <bits/stdc++.h>
using namespace std;
const int mx = 1e2;
int n, m;
array<int, 4> a[mx + 5];
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    cin >> a[i][1] >> a[i][0] >> a[i][2];
    a[i][3] = i + 1;
    a[i][1]--, a[i][0]--;
  }
  sort(a, a + m);
  vector<int> d(n, 0);
  for (int i = 0; i < m; i++) {
    int s = a[i][1], e = a[i][0], num = a[i][2], name = a[i][3];
    d[e] = m + 1;
    for (int j = s; j < e && num; j++) {
      if (!d[j]) {
        d[j] = name;
        num--;
      }
    }
    if (num) {
      cout << -1;
      return 0;
    }
  }
  for (auto i : d) cout << i << " ";
  return 0;
}
