#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 4;
vector<long long> ans(200, -1);
map<long long, long long> mp;
signed main() {
  cin.tie(0);
  cout.tie(0);
  ios_base::sync_with_stdio(0);
  long long n, k, i, j;
  cin >> n >> k;
  vector<pair<pair<long long, long long>, pair<long long, long long>>> vec;
  for (i = 0; i < k; i++) {
    long long a, b, c;
    cin >> a >> b >> c;
    vec.push_back({{b, a}, {c, i + 1}});
    ans[b] = k + 1;
  }
  sort(vec.begin(), vec.end());
  for (auto i : vec) {
    for (j = i.first.second; j < i.first.first; j++) {
      if (i.second.first == 0) break;
      if (ans[j] == -1) {
        ans[j] = i.second.second;
        i.second.first--;
      }
    }
    if (i.second.first) {
      cout << -1;
      return 0;
    }
  }
  for (i = 1; i <= n; i++) {
    if (ans[i] == -1) ans[i] = 0;
    cout << ans[i] << " ";
  }
}
