#include <bits/stdc++.h>
#define fi first
#define se second
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
const int INF = 1<<25;
using ll =  long long;
using vi = vector<int>;
using pi = pair<int,int>;
using vvi = vector<vector<int>>;

template <typename T>
struct RMQ {
    const T INF = numeric_limits<T>::max();
    int n;         // 葉の数
    vector<T> dat; // 完全二分木の配列
    RMQ(int n_) : n(), dat(n_ * 4, INF) { // 葉の数は 2^x の形
        int x = 1;
        while (n_ > x) {
            x *= 2;
        }
        n = x;
    }
    void update(int i, T x) {
        i += n - 1;
        dat[i] = x;
        while (i > 0) {
            i = (i - 1) / 2;  // parent
            dat[i] = min(dat[i * 2 + 1], dat[i * 2 + 2]);
        }
    }
    // the minimum element of [a,b)
    T query(int a, int b) { return query_sub(a, b, 0, 0, n); }
    T query_sub(int a, int b, int k, int l, int r) {
        if (r <= a || b <= l) {
            return INF;
        } else if (a <= l && r <= b) {
            return dat[k];
        } else {
            T vl = query_sub(a, b, k * 2 + 1, l, (l + r) / 2);
            T vr = query_sub(a, b, k * 2 + 2, (l + r) / 2, r);
            return min(vl, vr);
        }
    }
};

int main() {
  int n, q;cin >> n >> q;
  vvi ar1(n), ar2(n);
  vector<tuple<int,int,int>> que;
  rep(i, q) {
    int l,r,b;cin >> l >> r >> b;
    l--;r--;
    que.emplace_back(make_tuple(l,r,b));
    ar1[l].emplace_back(b);
    ar2[r].emplace_back(b);
  }
  multiset<int> ms;
  vi res(n, -1);
  rep(i, n) {
    for (int j : ar1[i]) {
      //cout << j << endl;
      ms.insert(j);
    }
    if(ms.size()==0)res[i] = 1;
    else res[i] = *ms.rbegin();
    //cout <<" "<< ms.size() << endl;
    for (int j : ar2[i]) {
      //cout << j << *ms.find(j) << endl;
      //if (ms.find(j)==ms.end())cout << "%" << endl;
      ms.erase(ms.find(j));
      //cout << "#" << endl;
    }
  }
/*   rep(i, n) {
    cout << res[i] << " ";
  }
  cout << endl; */
  RMQ<int> rmq(n);
  rep(i, n) {
    rmq.update(i, res[i]);
  }
  int ans = 1;
  rep(i, q) {
    int l,r,b;tie(l,r,b) = que[i];
    if (rmq.query(l, r+1) > b) {
      ans = 0;
      break;
    } 
  }
  if(ans) {
    rep(i, n){
      cout << res[i];
      if (i<n-1)cout << " ";
    }
    cout << endl;
  }
  else {
    cout << -1 << endl;
  }
}