#include using namespace std; using Int = long long; template struct SegmentTree{ typedef function F; typedef function G; typedef function H; typedef function P; Int n; F f; G g; H h; P p; T d1; E d0; vector dat; vector laz; SegmentTree(Int n_,F f,G g,H h,T d1,E d0, vector v=vector(),P p=[](E a,Int b){return a;}): f(f),g(g),h(h),d1(d1),d0(d0),p(p){ init(n_); if(n_==(Int)v.size()) build(n_,v); } void init(Int n_){ n=1; while(n v){ for(Int i=0;i=0;i--) dat[i]=f(dat[i*2+1],dat[i*2+2]); } inline void eval(Int len,Int k){ if(laz[k]==d0) return; if(k*2+1>n;n--; vector v(n); for(Int i=0;i>v[i]; for(Int i=0;i seg(n,f,g,g,0,0,v); Int m; cin>>m; for(Int i=0;i>l>>r>>x; l--; seg.update(l,r,x); cout<