#include <bits/stdc++.h>
using namespace std;
using ull = unsigned long long;
using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
using vu = vector<ull>;
using mii = map<int, int>;
using mll = map<ll, ll>;
using muu = map<ull, ull>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using puu = pair<ull, ull>;
using vii = vector<pii>;
using vll = vector<pll>;
using vuu = vector<puu>;
void pmain();
int main() {
  cin.tie(NULL);
  cout.tie(NULL);
  ios_base::sync_with_stdio(false);
  pmain();
  return 0;
}
template <class T>
T lcm(T a, T b) {
  return a / __gcd(a, b) * b;
}
template <class B, class E>
B binpow(B base, E exp) {
  if (exp == 0) return (B)1;
  if (exp == 1) return base;
  if (exp % 2 == 0) {
    B root = binpow<B, E>(base, exp / 2);
    return root * root;
  }
  return binpow<B, E>(base, exp - 1) * base;
}
template <class M, M mod, class B, class E>
B binpowmod(B base, E exp) {
  if (exp == 0) return (B)1;
  if (exp == 1) return base;
  if (exp % 2 == 0) {
    B root = binpowmod<M, mod, B, E>(base, exp / 2);
    return (root * root) % mod;
  }
  return (binpowmod<M, mod, B, E>(base, exp - 1) * base) % mod;
}
template <class N>
N arithsum(N a, N d, N n) {
  return (2 * a + (n - 1) * d) * n / 2;
}
template <class T>
void factors(T n, vector<T> &m) {
  T k = n;
  while (k % 2 == 0) {
    m.push_back(2);
    k /= 2;
  }
  for (T i = 3; i * i <= n; i += 2) {
    if (k % i == 0) {
      m.push_back(i);
      k /= i;
      --i;
    }
  }
  if (k != 0) {
    m.push_back(k);
  }
}
template <class T>
void factors(T n, map<T, T> &m) {
  T k = n;
  while (k % 2 == 0) {
    ++m[2];
    k /= 2;
  }
  for (T i = 3; i * i <= n; i += 2) {
    if (k % i == 0) {
      ++m[i];
      k /= i;
      --i;
    }
  }
  if (k != 0) {
    ++m[k];
  }
}
template <class T>
T count_divisors(const map<T, T> &v) {
  T a = 1;
  for (const auto &i : v) {
    a *= 1 + i.second;
  }
  return a;
}
template <class T>
bool between(T a, T v, T b) {
  return a < v && v < b;
}
template <class T>
bool betweeni(T a, T v, T b) {
  return a <= v && v <= b;
}
ll n, m;
set<pll> nearest;
set<ll> ending;
vll prep_start[105];
ll prep_rem[105];
vl res;
void pmain() {
  cin >> n >> m;
  for (ll i = 1; i <= m; ++i) {
    ll s, d, c;
    cin >> s >> d >> c;
    prep_start[s].push_back({d, i});
    prep_rem[i] = c;
  }
  for (ll i = 1; i <= n; ++i) {
    for (auto d : prep_start[i]) {
      nearest.insert(d);
    }
    if (!ending.empty() && *ending.begin() == i) {
      res.push_back(m + 1);
      ending.erase(ending.begin());
      continue;
    }
    if (!nearest.empty()) {
      ll end = nearest.begin()->first;
      ll exam = nearest.begin()->second;
      ll rem = prep_rem[exam];
      if (i >= end) {
        cout << -1 << endl;
        return;
      }
      --rem;
      prep_rem[exam] = rem;
      res.push_back(exam);
      if (rem == 0) {
        ending.insert(end);
        nearest.erase(nearest.begin());
      }
    } else {
      res.push_back(0);
    }
  }
  for (ll i : res) {
    cout << i << " ";
  }
  cout << endl;
}
