#include #include #include using namespace std; long op(long a,long b){return min(a,b);} long e(){return(long)1e18;} long mp(long f,long x){return f+x;} long id(){return 0L;} int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int Q,L; cin>>Q>>L; atcoder::lazy_segtreeseg(vector(L,0)); for(;Q--;) { int t,l,r,c;cin>>t>>l>>r>>c; if(t==2)c=-c; seg.apply(l,r,c); cout<