#include <bits/stdc++.h>
int ans[101];
int cnt[101];
int s[101], d[101], c[101];
int test_day[101];
int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  for (int i = 1; i <= m; ++i) {
    scanf("%d %d %d", s + i, d + i, c + i);
    ans[d[i]] = m + 1;
    test_day[d[i]] = i;
  }
  for (int i = 1; i <= n; ++i) {
    if (test_day[i]) {
      if (cnt[test_day[i]] < c[test_day[i]]) {
        printf("-1\n");
        return 0;
      }
    } else {
      int test = 0;
      for (int j = 1; j <= m; ++j) {
        if (s[j] <= i && cnt[j] < c[j]) {
          if (test == 0 || d[test] > d[j]) test = j;
        }
      }
      ans[i] = test;
      cnt[test]++;
    }
  }
  for (int i = 1; i <= n; ++i) {
    printf("%d ", ans[i]);
  }
  return 0;
}
