#include <bits/stdc++.h>
using namespace std;
pair<int, pair<int, pair<int, int> > > p[200];
map<int, int> mp;
vector<int> v;
set<int> st;
set<int>::iterator it;
int main() {
  int n, m, sum = 0, i, j, co = 0;
  cin >> n >> m;
  for (i = 0; i < m; i++) {
    scanf("%d%d%d", &p[i].second.first, &p[i].first, &p[i].second.second.first);
    p[i].second.second.second = i + 1;
    st.insert(p[i].first);
    sum += p[i].second.second.first;
    if (p[i].second.second.first > p[i].first - p[i].second.first) co++;
  }
  if (sum + m > n || co > 0) {
    cout << "-1";
    return 0;
  }
  sort(p, p + m);
  for (i = 1; i <= n; i++) {
    it = st.find(i);
    if (it != st.end()) {
      v.push_back(m + 1);
      continue;
    }
    for (j = 0; j < m; j++) {
      if (p[j].second.first <= i && p[j].second.second.first > 0 &&
          p[j].first > i) {
        mp[p[j].second.second.second]++;
        if (mp[p[j].second.second.second] == p[j].second.second.first) {
          p[j].second.second.first = 0;
        }
        v.push_back(p[j].second.second.second);
        break;
      }
    }
    if (j == m) {
      v.push_back(0);
    }
  }
  for (i = 0; i < m; i++) {
    if (p[i].second.second.first != 0) {
      cout << "-1";
      return 0;
    }
  }
  for (i = 0; i < v.size(); i++) cout << v[i] << " ";
  return 0;
}
