#include <bits/stdc++.h>
using namespace std;
struct nds {
  long long a, b, c, p;
};
bool cmp(nds x, nds y) {
  if (x.a == y.a) {
    return x.b < y.b;
  } else {
    return x.a < y.a;
  }
}
void solve() {
  long long n, m;
  cin >> n >> m;
  long long ans[n + 1];
  memset(ans, (-1), sizeof(ans));
  nds x[m + 1];
  for (long long i = (1); i <= (m); i++) {
    cin >> x[i].a >> x[i].b >> x[i].c;
    x[i].p = i;
  }
  sort(x + 1, x + m + 1, cmp);
  long long cr = 1;
  vector<long long> r;
  for (long long i = (1); i <= (n); i++) {
    while (x[cr].a <= i && cr <= m) {
      r.push_back(cr);
      cr += 1;
    }
    for (long long j = (0); j <= (r.size() - 1ll); j++) {
      long long in = r[j];
      if (x[in].b == i) {
        if (x[in].c != 0) {
          cout << -1 << endl;
          return;
        } else {
          ans[i] = m + 1;
        }
      }
    }
    if (ans[i] != -1) {
      continue;
    }
    long long ret = 100000000000000000ll, pre = -1;
    for (long long j = (0); j <= (r.size() - 1ll); j++) {
      long long in = r[j];
      if (x[in].c > 0) {
        if (x[in].b < ret) {
          ret = x[in].b;
          pre = in;
        }
      }
    }
    if (pre == -1) {
      ans[i] = 0;
    } else {
      x[pre].c -= 1;
      ans[i] = x[pre].p;
    }
  }
  for (long long i = (1); i <= (n); i++) {
    cout << ans[i] << " ";
  }
  cout << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  while (t--) {
    solve();
  }
}
