#include <bits/stdc++.h>
using namespace std;
struct exam {
  int s, d, c, id;
} a[105];
int n, m, ans[105];
bool cmp(exam a, exam b) { return a.d < b.d; }
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= m; i++) {
    scanf("%d%d%d", &a[i].s, &a[i].d, &a[i].c);
    a[i].id = i;
    ans[a[i].d] = m + 1;
    if (a[i].d - a[i].s < a[i].c) {
      puts("-1");
      return 0;
    }
  }
  sort(a + 1, a + m + 1, cmp);
  for (int i = 1; i <= n; i++)
    if (!ans[i])
      for (int j = 1; j <= m; j++)
        if (a[j].c && a[j].s <= i && a[j].d > i) {
          --a[j].c;
          ans[i] = a[j].id;
          break;
        }
  for (int i = 1; i <= m; i++)
    if (a[i].c) {
      puts("-1");
      return 0;
    }
  for (int i = 1; i <= n; i++) printf("%d ", ans[i]);
  return 0;
}
