#include <bits/stdc++.h>
using namespace std;
using uint = unsigned int;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;
using pli = pair<ll, int>;
using pil = pair<int, ll>;
using pll = pair<ll, ll>;
template <typename T>
using vec = vector<T>;
using vi = vec<int>;
using vl = vec<ll>;
template <typename T>
using que = queue<T>;
template <typename T>
using deq = deque<T>;
template <typename T>
T id(T b) {
  return b;
};
template <typename T>
void chmax(T &x, T y) {
  if (x < y) x = y;
}
template <typename T>
void chmin(T &x, T y) {
  if (x > y) x = y;
}
template <typename S, typename K>
bool contains(S s, K k) {
  return s.find(k) != s.end();
}
void fastio() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
}
constexpr ll TEN(int n) {
  if (n == 0)
    return 1LL;
  else
    return 10LL * TEN(n - 1);
}
const int MAX_N = 100;
int n, m;
vi s[MAX_N + 1];
int d[MAX_N];
int rd[MAX_N + 1];
int c[MAX_N];
int ans[MAX_N + 1];
bool done[MAX_N];
int main() {
  fastio();
  fill_n(rd, MAX_N + 1, -1);
  cin >> n >> m;
  for (size_t i = 0; i < size_t(m); i++) {
    int a;
    cin >> a >> d[i] >> c[i];
    s[a].push_back(i);
    rd[d[i]] = i;
  }
  set<pii> ds;
  for (size_t i = 1; i <= size_t(n); i++) {
    for (int k : s[i]) {
      ds.insert(make_pair(d[k], k));
    }
    if (rd[i] >= 0) {
      if (!done[rd[i]]) {
        cout << -1 << '\n';
        return 0;
      } else {
        ans[i] = m + 1;
      }
    } else if (ds.empty()) {
      ans[i] = 0;
    } else {
      auto [_, k] = *ds.begin();
      ans[i] = k + 1;
      c[k]--;
      if (!c[k]) {
        done[k] = true;
        ds.erase(ds.begin());
      }
    }
  }
  for (size_t i = 1; i <= size_t(n); i++) {
    cout << ans[i] << ' ';
  }
  cout << endl;
  return 0;
}
