#include #include using namespace std; using namespace atcoder; using ll=long long; using ld=long double; using S = long long; using F = long long; ll inf=1000000000; const S INF = inf; const F ID = inf+1; S op(S a, S b){ return std::min(a, b); } S e(){ return INF; } S mapping(F f, S x){ return (f == ID ? x : f); } F composition(F f, F g){ return (f == ID ? g : f); } F id(){ return ID; } ld pie=3.141592653589793; ll mod=1000000007; int main(){ ll n,q; cin >> n >> q; vectorl(q),r(q),b(q); vector>>p(q); for (ll i = 0; i < q; i++) { cin >> l[i] >> r[i] >> b[i]; l[i]--; p[i]={b[i],{l[i],r[i]}}; } sort(p.begin(),p.end()); vectorv(n,inf); atcoder::lazy_segtree seg(v); for (ll i = 0; i < p.size(); i++) { seg.apply(p[i].second.first,p[i].second.second,p[i].first); } bool ok=true; for (ll i = 0; i < p.size(); i++) { ll x=seg.prod(p[i].second.first,p[i].second.second); if (x!=p[i].first) { ok=false; break; } } if (ok) { vectora(n); for (ll i = 0; i < n; i++) { a[i]=seg.get(i); } for (ll i = 0; i < n; i++) { cout << a[i]; if (i