#include <bits/stdc++.h>
using namespace std;
vector<pair<pair<int, int>, pair<int, int>>> routine;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n = 0, m = 0;
  cin >> n >> m;
  int ansArr[105] = {0};
  for (int i = 0; i < m; i++) {
    int publicationDay, examDay, cost;
    cin >> publicationDay >> examDay >> cost;
    routine.emplace_back(make_pair(examDay, publicationDay),
                         make_pair(cost, i + 1));
    ansArr[examDay] = m + 1;
  }
  sort(routine.begin(), routine.end());
  for (int i = 0; i < m; i++) {
    int index = routine[i].second.second;
    int daysToPrepare = routine[i].second.first;
    int startingDay = routine[i].first.second;
    int endingDay = routine[i].first.first;
    while (startingDay < endingDay and daysToPrepare > 0) {
      if (ansArr[startingDay] == 0) {
        ansArr[startingDay] = index;
        daysToPrepare--;
      }
      startingDay++;
    }
    if (daysToPrepare > 0) {
      cout << -1;
      return 0;
    }
  }
  for (int i = 1; i <= n; i++) {
    cout << ansArr[i] << " ";
  }
  return 0;
}
