#include <bits/stdc++.h>
using namespace std;
mt19937 rng(time(0));
uniform_int_distribution<int> uid(-1e9, 1e9);
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, m;
  cin >> n >> m;
  vector<int> res(n, 0);
  vector<vector<int>> v(m, vector<int>(3));
  for (auto& i : v) cin >> i[0] >> i[1] >> i[2], res[i[1] - 1] = m + 1;
  for (int i = 0; i < n; ++i) {
    if (res[i]) continue;
    int x = 1e9, y = 0;
    for (int j = 0; j < m; ++j)
      if (v[j][0] <= i + 1 && i + 1 < v[j][1] && v[j][2] && v[j][1] < x)
        y = j, x = v[j][1];
    if (x != 1e9) res[i] = y + 1, --v[y][2];
  }
  for (int i = 0; i < m; ++i)
    if (v[i][2]) {
      cout << -1;
      exit(0);
    }
  for (auto& i : res) cout << i << ' ';
}
