#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const double eps = 1e-3;
const int MAXN = 2e5 + 10;
const int MAXM = 1e4 + 10;
const long long mod = 1e9;
int ans[110];
struct node {
  int be, en, day, id;
} a[110];
bool cmp(node x, node y) {
  if (x.en != y.en)
    return x.en < y.en;
  else if (x.day != y.day)
    return x.day > y.day;
  return x.be < y.be;
}
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= m; i++) {
    scanf("%d%d%d", &a[i].be, &a[i].en, &a[i].day);
    a[i].id = i;
    ans[a[i].en] = m + 1;
  }
  sort(a + 1, a + 1 + m, cmp);
  for (int i = 1; i <= n; i++) {
    if (ans[i] == m + 1) continue;
    int now = 0;
    for (int j = 1; j <= m; j++) {
      if (a[j].day == 0) continue;
      if (a[j].be <= i && a[j].en > i && a[j].day) {
        now = a[j].id;
        a[j].day--;
        break;
      }
    }
    ans[i] = now;
  }
  for (int i = 1; i <= m; i++) {
    if (a[i].day != 0) {
      puts("-1");
      return 0;
    }
  }
  for (int i = 1; i <= n; i++) printf("%d ", ans[i]);
  return 0;
}
