#include <bits/stdc++.h>
using namespace std;
const int maxn = 100 + 5;
struct W {
  int s, c, d;
} w[maxn];
int ans[maxn];
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  int N, M;
  cin >> N >> M;
  memset(ans, 0, sizeof(ans));
  for (int i = 1; i <= M; i++) {
    cin >> w[i].s >> w[i].d >> w[i].c;
    ans[w[i].d] = M + 1;
  }
  for (int i = 1; i <= N; i++) {
    int mn = 0x3f3f3f3f, idx = -1;
    if (ans[i]) continue;
    for (int j = 1; j <= M; j++) {
      if (i >= w[j].s && i < w[j].d && w[j].c > 0) {
        if (w[j].d < mn) {
          mn = w[j].d;
          idx = j;
        }
      }
    }
    if (mn == 0x3f3f3f3f)
      ans[i] = 0;
    else {
      ans[i] = idx;
      w[idx].c--;
    }
  }
  int k = 0;
  for (int i = 1; i <= M; i++) {
    k += w[i].c;
  }
  if (k) {
    cout << -1 << '\n';
    return 0;
  }
  for (int i = 1; i <= N; i++) cout << ans[i] << ' ';
  cout << '\n';
}
