#include <bits/stdc++.h>
using namespace std;
struct exam {
  int pb, date, cnt, idx;
  bool operator<(const exam &a) const { return date > a.date; }
};
bool cmp(exam &a, exam &b) { return a.pb < b.pb; }
int ans[101], ap;
exam arr[101];
priority_queue<exam> pq;
int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  for (int i = 0; i < m; i++) {
    scanf("%d %d %d", &arr[i].pb, &arr[i].date, &arr[i].cnt);
    arr[i].idx = i + 1;
  }
  sort(arr, arr + m, cmp);
  for (int i = 1; i <= n; i++) {
    while (ap < m && arr[ap].pb == i) {
      ans[arr[ap].date] = m + 1;
      pq.push(arr[ap++]);
    }
    if (pq.empty() || ans[i] != 0)
      continue;
    else {
      exam tmp = pq.top();
      pq.pop();
      if (tmp.date < i) return !printf("-1");
      ans[i] = tmp.idx;
      tmp.cnt--;
      if (tmp.cnt > 0) pq.push(tmp);
    }
  }
  if (!pq.empty()) return !printf("-1");
  for (int i = 1; i <= n; i++) {
    printf("%d ", ans[i]);
  }
  return 0;
}
