#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  vector<pair<pair<int, int>, pair<int, int> > > a;
  cin >> n >> m;
  priority_queue<pair<int, pair<int, int> >,
                 vector<pair<int, pair<int, int> > >,
                 greater<pair<int, pair<int, int> > > >
      piu;
  vector<int> resp(n);
  for (int i = 0; i < m; i++) {
    int s, d, c;
    cin >> s >> d >> c;
    pair<pair<int, int>, pair<int, int> > aux;
    pair<int, pair<int, int> > aux1;
    aux.first.first = s;
    aux.first.second = d;
    aux.second.first = c;
    aux.second.second = i;
    aux1.first = d;
    aux1.second.first = c;
    aux1.second.second = i + 1;
    a.push_back(aux);
    piu.push(aux1);
  }
  int possible = 1;
  for (int i = 1; i <= n; i++) {
    if (!piu.empty() && a[(piu.top().second.second) - 1].first.first > i) {
      int min = 0x3f3f3f;
      int respw = -1;
      for (int j = 0; j < a.size(); j++) {
        if (a[j].first.second < min && a[j].first.first <= i &&
            a[j].second.first > 0) {
          min = a[j].first.second;
          respw = j;
        }
      }
      if (respw > -1) {
        resp[i - 1] = (a[respw].second.second) + 1;
        a[respw].second.first--;
      } else {
        resp[i - 1] = 0;
      }
    } else {
      if (!piu.empty() && piu.top().first == i &&
          a[(piu.top().second.second) - 1].second.first <= 0) {
        resp[i - 1] = m + 1;
        piu.pop();
      } else if (!piu.empty() && piu.top().first < i) {
        possible = 0;
      } else if (!piu.empty() &&
                 a[(piu.top().second.second) - 1].second.first > 0) {
        resp[i - 1] = a[(piu.top().second.second) - 1].second.second + 1;
        a[(piu.top().second.second) - 1].second.first--;
      } else {
        int min = 0x3f3f3f;
        int respw = -1;
        for (int j = 0; j < a.size(); j++) {
          if (a[j].first.second < min && a[j].first.first <= i &&
              a[j].second.first > 0) {
            min = a[j].first.second;
            respw = j;
          }
        }
        if (respw > -1) {
          resp[i - 1] = (a[respw].second.second) + 1;
          a[respw].second.first--;
        } else {
          resp[i - 1] = 0;
        }
      }
    }
    if (i == n && !piu.empty()) {
      possible = 0;
    }
  }
  if (possible) {
    for (int i = 0; i < n; i++) {
      i < n - 1 ? cout << resp[i] << " " : cout << resp[i] << endl;
    }
  } else {
    puts("-1");
  }
  return 0;
}
