#include <bits/stdc++.h>
using namespace std;
const int maxN = 110;
int n, m, a[maxN];
int i;
struct Exams {
  int s, d, c, index;
  bool operator<(const Exams &e) const { return d < e.d; }
} exam;
vector<Exams> exams;
int main() {
  memset(a, 0, sizeof(a));
  cin >> n >> m;
  for (i = 1; i <= m; i++) {
    cin >> exam.s >> exam.d >> exam.c;
    exam.index = i;
    a[exam.d] = m + 1;
    exams.push_back(exam);
  }
  sort(exams.begin(), exams.end());
  for (auto it : exams) {
    int days = it.c;
    for (i = it.s; i < it.d; i++) {
      if (a[i] == 0) {
        a[i] = it.index;
        days--;
      }
      if (days == 0) {
        break;
      }
    }
    if (days > 0) {
      cout << -1 << endl;
      return 0;
    }
  }
  for (i = 1; i <= n; i++) {
    cout << a[i] << " ";
  }
  return 0;
}
