#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 100 + 10;
pair<int, int> d[MAX_N];
int s[MAX_N], c[MAX_N];
int a[MAX_N];
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int x;
    cin >> s[i] >> x >> c[i];
    a[x] = m + 1, d[i] = {x, i};
  }
  sort(d, d + m);
  for (int i = 0; i < m; i++) {
    int p = d[i].second;
    for (int j = s[p]; c[p] && j < d[i].first; j++)
      if (!a[j]) a[j] = p + 1, c[p]--;
    if (c[p]) return cout << "-1\n", 0;
  }
  for (int i = 1; i <= n; i++) cout << a[i] << ' ';
  return 0;
}
