#include <bits/stdc++.h>
using namespace std;

#define trace1(x)                cerr << #x << ": " << x << endl;
#define trace2(x, y)             cerr << #x << ": " << x << " | " << #y << ": " << y << endl;
#define trace3(x, y, z)          cerr << #x << ": " << x << " | " << #y << ": " << y << " | " << #z << ": " << z << endl;
#define trace4(a, b, c, d)       cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << endl;
#define bitcount    __builtin_popcountll
#define si(x)       scanf("%d",&x)
#define su(x)       scanf("%u",&x)
#define sll(x)      scanf("%lld",&x)
#define sl(x)       scanf("%ld",&x)
#define sc(x)       scanf("%c",&x)
#define ss(x)       scanf("%s",x)
#define sf(x)       scanf("%f",&x)
#define slf(x)      scanf("%lf",&x)
#define pri(x)      printf("%d\n",x)
#define prl(x)      printf("%lld\n",x)
#define ll          long long int
#define pb          push_back
#define mp          make_pair
#define pii         pair<int,int>
#define pll         pair<long long,long long>
#define pil         pair<int,long long>
#define pli         pair<long long,int>
#define vi          vector<int>
#define vl          vector<long long>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (int)x.size()
#define rep(i,a,b)  for(int i=a;i<=b;i++)
#define repl(i,a,b) for(long long i=a;i<=b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define rrepl(i,a,b) for(long long i=a;i>=b;i--)
#define M           1000000007

const int maxn=3*1e6+100;
vector<pair<pii,int> > q1;
vector<pair<pii,int> > q2;
set<int>s1;
int arr[maxn],st[maxn],st_auxilary[maxn],lazy[maxn];
vi v1;

void build(int si,int l,int r){
    if(l==r){
        st[si]=st_auxilary[si]=arr[l];
        return;
    }
    int mid=l+(r-l)/2;
    build(2*si+1,l,mid);
    build(2*si+2,mid+1,r);
    st[si]=st[2*si+1]+st[2*si+2];
    st_auxilary[si]=st_auxilary[2*si+1]+st_auxilary[2*si+2];
}

void update(int qs,int qe,int ss,int se,int si,int flag){
    //trace4(st[si],si,ss,se);
    if(lazy[si]==1){
        st[si]=0;
        if(ss!=se){
            lazy[2*si+1]=lazy[si];
            lazy[2*si+2]=lazy[si];
        }
        lazy[si]=0;
    }
    else if(lazy[si]==2){
        st[si]=st_auxilary[si];
        if(ss!=se){
            lazy[2*si+1]=lazy[si];
            lazy[2*si+2]=lazy[si];
        }
        lazy[si]=0;
    }
    if(ss>se or qs>se or ss>qe) return;
    if(ss>=qs and se<=qe){
        if(flag==1) st[si]=0;
        else if(flag==2) st[si]=st_auxilary[si];
        if(ss!=se){
            lazy[2*si+1]=flag;
            lazy[2*si+2]=flag;
        }
        return;
    }
    int mid=(ss+se)>>1;
   if(!((qs>mid or ss>qe) and !lazy[2*si+1]))
        update(qs,qe,ss,mid,2*si+1,flag);
    if(!((qs>se or (mid+1)>qe) and !lazy[2*si+2]))
        update(qs,qe,mid+1,se,2*si+2,flag);
    st[si]=st[2*si+1]+st[2*si+2];
}

void solve(){
    int n,q;
    si(n); si(q);
    s1.insert(1);
    s1.insert(n+1);
    rep(i,1,q){
        int l,r,k;
        si(l); si(r); si(k);
        q1.pb(mp(mp(l,r),k));
        s1.insert(l);
        s1.insert(r+1);
    }
    set<int>::iterator it=s1.begin();
    set<int>::iterator it1=it;
    v1.pb(*it);
    it1++;
    int k=0;
    while(it1!=s1.end()){
        int dif=(*it1)-(*it);
        arr[k]=dif;
        v1.pb(*it1);
        k++;
        it++;
        it1++;
    }

    rep(i,0,q-1){
        int pos1=lower_bound(all(v1),q1[i].F.F)-v1.begin();
        int pos2=lower_bound(all(v1),q1[i].F.S+1)-v1.begin();
        pos2--;
        q2.pb(mp(mp(pos1,pos2),q1[i].S));
    }
    build(0,0,k-1);
    //trace1(st[0]);
    rep(i,0,q-1){
        update(q2[i].F.F,q2[i].F.S,0,k-1,0,q2[i].S);
        printf("%d\n",st[0]);
    }
}

int main()
{
    //ios_base::sync_with_stdio(false);
    //cin.tie(NULL);
    //cout.tie(NULL);
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    int t=1;
    //si(t);
    while(t--){
        solve();
    }

    return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define trace1(x)                cerr << #x << ": " << x << endl;
#define trace2(x, y)             cerr << #x << ": " << x << " | " << #y << ": " << y << endl;
#define trace3(x, y, z)          cerr << #x << ": " << x << " | " << #y << ": " << y << " | " << #z << ": " << z << endl;
#define trace4(a, b, c, d)       cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << endl;
#define bitcount    __builtin_popcountll
#define si(x)       scanf("%d",&x)
#define su(x)       scanf("%u",&x)
#define sll(x)      scanf("%lld",&x)
#define sl(x)       scanf("%ld",&x)
#define sc(x)       scanf("%c",&x)
#define ss(x)       scanf("%s",x)
#define sf(x)       scanf("%f",&x)
#define slf(x)      scanf("%lf",&x)
#define pri(x)      printf("%d\n",x)
#define prl(x)      printf("%lld\n",x)
#define ll          long long int
#define pb          push_back
#define mp          make_pair
#define pii         pair<int,int>
#define pll         pair<long long,long long>
#define pil         pair<int,long long>
#define pli         pair<long long,int>
#define vi          vector<int>
#define vl          vector<long long>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (int)x.size()
#define rep(i,a,b)  for(int i=a;i<=b;i++)
#define repl(i,a,b) for(long long i=a;i<=b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define rrepl(i,a,b) for(long long i=a;i>=b;i--)
#define M           1000000007

const int maxn=4e6+100;
vector<pair<pii,int> > q1;
vector<pair<pii,int> > q2;
set<int>s1;
int arr[maxn],st[maxn],st_auxilary[maxn],lazy[maxn];
vi v1;

void build(int si,int l,int r){
    if(l==r){
        st[si]=st_auxilary[si]=arr[l];
        return;
    }
    int mid=l+(r-l)/2;
    build(2*si+1,l,mid);
    build(2*si+2,mid+1,r);
    st[si]=st[2*si+1]+st[2*si+2];
    st_auxilary[si]=st_auxilary[2*si+1]+st_auxilary[2*si+2];
}

void update(int qs,int qe,int ss,int se,int si,int flag){
    //trace4(st[si],si,ss,se);
    if(lazy[si]==1){
        st[si]=0;
        if(ss!=se){
            lazy[2*si+1]=lazy[si];
            lazy[2*si+2]=lazy[si];
        }
        lazy[si]=0;
    }
    else if(lazy[si]==2){
        st[si]=st_auxilary[si];
        if(ss!=se){
            lazy[2*si+1]=lazy[si];
            lazy[2*si+2]=lazy[si];
        }
        lazy[si]=0;
    }
    if(qs>se or ss>qe) return;
    if(ss>=qs and se<=qe){
        if(flag==1) st[si]=0;
        else if(flag==2) st[si]=st_auxilary[si];
        if(ss!=se){
            lazy[2*si+1]=flag;
            lazy[2*si+2]=flag;
        }
        return;
    }
    int mid=ss+(se-ss)/2;
    update(qs,qe,ss,mid,2*si+1,flag);
    update(qs,qe,mid+1,se,2*si+2,flag);
    st[si]=st[2*si+1]+st[2*si+2];
}

void solve(){
    int n,q;
    si(n); si(q);
    s1.insert(1);
    s1.insert(n+1);
    rep(i,1,q){
        int l,r,k;
        si(l); si(r); si(k);
        q1.pb(mp(mp(l,r),k));
        s1.insert(l);
        s1.insert(r+1);
    }
    auto it=s1.begin();
    auto it1=s1.begin();
    v1.pb(*it);
    it1++;
    int k=0;
    while(it1!=s1.end()){
        int dif=(*it1)-(*it);
        arr[k]=dif;
        v1.pb(*it1);
        k++;
        it++;
        it1++;
    }
    rep(i,0,sz(q1)-1){
        int pos1=lower_bound(all(v1),q1[i].F.F)-v1.begin();
        int pos2=lower_bound(all(v1),q1[i].F.S+1)-v1.begin();
        pos2--;
        q2.pb(mp(mp(pos1,pos2),q1[i].S));
    }
    build(0,0,k-1);
    //trace1(st[0]);
    rep(i,0,sz(q2)-1){
        update(q2[i].F.F,q2[i].F.S,0,k-1,0,q2[i].S);
        pri(st[0]);
    }
}

int main()
{
    //ios_base::sync_with_stdio(false);
    //cin.tie(NULL);
    //cout.tie(NULL);
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    int t=1;
    //si(t);
    while(t--){
        solve();
    }

    return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define trace1(x)                cerr << #x << ": " << x << endl;
#define trace2(x, y)             cerr << #x << ": " << x << " | " << #y << ": " << y << endl;
#define trace3(x, y, z)          cerr << #x << ": " << x << " | " << #y << ": " << y << " | " << #z << ": " << z << endl;
#define trace4(a, b, c, d)       cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << endl;
#define bitcount    __builtin_popcountll
#define si(x)       scanf("%d",&x)
#define su(x)       scanf("%u",&x)
#define sll(x)      scanf("%lld",&x)
#define sl(x)       scanf("%ld",&x)
#define sc(x)       scanf("%c",&x)
#define ss(x)       scanf("%s",x)
#define sf(x)       scanf("%f",&x)
#define slf(x)      scanf("%lf",&x)
#define pri(x)      printf("%d\n",x)
#define prl(x)      printf("%lld\n",x)
#define ll          long long int
#define pb          push_back
#define mp          make_pair
#define pii         pair<int,int>
#define pll         pair<long long,long long>
#define pil         pair<int,long long>
#define pli         pair<long long,int>
#define vi          vector<int>
#define vl          vector<long long>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (int)x.size()
#define rep(i,a,b)  for(int i=a;i<=b;i++)
#define repl(i,a,b) for(long long i=a;i<=b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define rrepl(i,a,b) for(long long i=a;i>=b;i--)
#define M           1000000007

const int maxn=3e6+100;
vector<pair<pii,int> > q1;
vector<pair<pii,int> > q2;
set<int>s1;
int arr[maxn],st[maxn],st_auxilary[maxn],lazy[maxn];
vi v1;

void build(int si,int l,int r){
    if(l==r){
        st[si]=st_auxilary[si]=arr[l];
        return;
    }
    int mid=l+(r-l)/2;
    build(2*si+1,l,mid);
    build(2*si+2,mid+1,r);
    st[si]=st[2*si+1]+st[2*si+2];
    st_auxilary[si]=st_auxilary[2*si+1]+st_auxilary[2*si+2];
}

void update(int qs,int qe,int ss,int se,int si,int flag){
    //trace4(st[si],si,ss,se);
    if(lazy[si]==1){
        st[si]=0;
        if(ss!=se){
            lazy[2*si+1]=lazy[si];
            lazy[2*si+2]=lazy[si];
        }
        lazy[si]=0;
    }
    else if(lazy[si]==2){
        st[si]=st_auxilary[si];
        if(ss!=se){
            lazy[2*si+1]=lazy[si];
            lazy[2*si+2]=lazy[si];
        }
        lazy[si]=0;
    }
    if(qs>se or ss>qe) return;
    if(ss>=qs and se<=qe){
        if(flag==1) st[si]=0;
        else if(flag==2) st[si]=st_auxilary[si];
        if(ss!=se){
            lazy[2*si+1]=flag;
            lazy[2*si+2]=flag;
        }
        return;
    }
    int mid=ss+(se-ss)/2;
    update(qs,qe,ss,mid,2*si+1,flag);
    update(qs,qe,mid+1,se,2*si+2,flag);
    st[si]=st[2*si+1]+st[2*si+2];
}

void solve(){
    int n,q;
    si(n); si(q);
    s1.insert(1);
    s1.insert(n+1);
    rep(i,1,q){
        int l,r,k;
        si(l); si(r); si(k);
        q1.pb(mp(mp(l,r),k));
        s1.insert(l);
        s1.insert(r+1);
    }
    auto it=s1.begin();
    auto it1=s1.begin();
    v1.pb(*it);
    it1++;
    int k=0;
    while(it1!=s1.end()){
        int dif=(*it1)-(*it);
        arr[k]=dif;
        v1.pb(*it1);
        k++;
        it++;
        it1++;
    }
    rep(i,0,sz(q1)-1){
        int pos1=lower_bound(all(v1),q1[i].F.F)-v1.begin();
        int pos2=lower_bound(all(v1),q1[i].F.S+1)-v1.begin();
        pos2--;
        q2.pb(mp(mp(pos1,pos2),q1[i].S));
    }
    build(0,0,k-1);
    //trace1(st[0]);
    rep(i,0,sz(q2)-1){
        update(q2[i].F.F,q2[i].F.S,0,k-1,0,q2[i].S);
        pri(st[0]);
    }
}

int main()
{
    //ios_base::sync_with_stdio(false);
    //cin.tie(NULL);
    //cout.tie(NULL);
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    int t=1;
    //si(t);
    while(t--){
        solve();
    }

    return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define trace1(x)                cerr << #x << ": " << x << endl;
#define trace2(x, y)             cerr << #x << ": " << x << " | " << #y << ": " << y << endl;
#define trace3(x, y, z)          cerr << #x << ": " << x << " | " << #y << ": " << y << " | " << #z << ": " << z << endl;
#define trace4(a, b, c, d)       cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << endl;
#define bitcount    __builtin_popcountll
#define si(x)       scanf("%d",&x)
#define su(x)       scanf("%u",&x)
#define sll(x)      scanf("%lld",&x)
#define sl(x)       scanf("%ld",&x)
#define sc(x)       scanf("%c",&x)
#define ss(x)       scanf("%s",x)
#define sf(x)       scanf("%f",&x)
#define slf(x)      scanf("%lf",&x)
#define pri(x)      printf("%d\n",x)
#define prl(x)      printf("%lld\n",x)
#define ll          long long int
#define pb          push_back
#define mp          make_pair
#define pii         pair<int,int>
#define pll         pair<long long,long long>
#define pil         pair<int,long long>
#define pli         pair<long long,int>
#define vi          vector<int>
#define vl          vector<long long>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (int)x.size()
#define rep(i,a,b)  for(int i=a;i<=b;i++)
#define repl(i,a,b) for(long long i=a;i<=b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define rrepl(i,a,b) for(long long i=a;i>=b;i--)
#define M           1000000007

const int maxn=1e6+100;
vector<pair<pii,int> > q1;
vector<pair<pii,int> > q2;
set<int>s1;
int arr[maxn],st[maxn],st_auxilary[maxn],lazy[maxn];
vi v1;

void build(int si,int l,int r){
    if(l==r){
        st[si]=st_auxilary[si]=arr[l];
        return;
    }
    int mid=l+(r-l)/2;
    build(2*si+1,l,mid);
    build(2*si+2,mid+1,r);
    st[si]=st[2*si+1]+st[2*si+2];
    st_auxilary[si]=st_auxilary[2*si+1]+st_auxilary[2*si+2];
}

void update(int qs,int qe,int ss,int se,int si,int flag){
    //trace4(st[si],si,ss,se);
    if(lazy[si]==1){
        st[si]=0;
        if(ss!=se){
            lazy[2*si+1]=lazy[si];
            lazy[2*si+2]=lazy[si];
        }
        lazy[si]=0;
    }
    else if(lazy[si]==2){
        st[si]=st_auxilary[si];
        if(ss!=se){
            lazy[2*si+1]=lazy[si];
            lazy[2*si+2]=lazy[si];
        }
        lazy[si]=0;
    }
    if(qs>se or ss>qe) return;
    if(ss>=qs and se<=qe){
        if(flag==1) st[si]=0;
        else if(flag==2) st[si]=st_auxilary[si];
        if(ss!=se){
            lazy[2*si+1]=flag;
            lazy[2*si+2]=flag;
        }
        return;
    }
    int mid=ss+(se-ss)/2;
    update(qs,qe,ss,mid,2*si+1,flag);
    update(qs,qe,mid+1,se,2*si+2,flag);
    st[si]=st[2*si+1]+st[2*si+2];
}

void solve(){
    int n,q;
    si(n); si(q);
    s1.insert(1);
    s1.insert(n+1);
    rep(i,1,q){
        int l,r,k;
        si(l); si(r); si(k);
        q1.pb(mp(mp(l,r),k));
        s1.insert(l);
        s1.insert(r+1);
    }
    auto it=s1.begin();
    auto it1=s1.begin();
    v1.pb(*it);
    it1++;
    int k=0;
    while(it1!=s1.end()){
        int dif=(*it1)-(*it);
        arr[k]=dif;
        v1.pb(*it1);
        k++;
        it++;
        it1++;
    }
    rep(i,0,sz(q1)-1){
        int pos1=lower_bound(all(v1),q1[i].F.F)-v1.begin();
        int pos2=lower_bound(all(v1),q1[i].F.S+1)-v1.begin();
        pos2--;
        q2.pb(mp(mp(pos1,pos2),q1[i].S));
    }
    build(0,0,k-1);
    //trace1(st[0]);
    rep(i,0,sz(q2)-1){
        update(q2[i].F.F,q2[i].F.S,0,k-1,0,q2[i].S);
        pri(st[0]);
    }
}

int main()
{
    //ios_base::sync_with_stdio(false);
    //cin.tie(NULL);
    //cout.tie(NULL);
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    int t=1;
    //si(t);
    while(t--){
        solve();
    }

    return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define trace1(x)                cerr << #x << ": " << x << endl;
#define trace2(x, y)             cerr << #x << ": " << x << " | " << #y << ": " << y << endl;
#define trace3(x, y, z)          cerr << #x << ": " << x << " | " << #y << ": " << y << " | " << #z << ": " << z << endl;
#define trace4(a, b, c, d)       cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << endl;
#define bitcount    __builtin_popcountll
#define si(x)       scanf("%d",&x)
#define su(x)       scanf("%u",&x)
#define sll(x)      scanf("%lld",&x)
#define sl(x)       scanf("%ld",&x)
#define sc(x)       scanf("%c",&x)
#define ss(x)       scanf("%s",x)
#define sf(x)       scanf("%f",&x)
#define slf(x)      scanf("%lf",&x)
#define pri(x)      printf("%d\n",x)
#define prl(x)      printf("%lld\n",x)
#define ll          long long int
#define pb          push_back
#define mp          make_pair
#define pii         pair<int,int>
#define pll         pair<long long,long long>
#define pil         pair<int,long long>
#define pli         pair<long long,int>
#define vi          vector<int>
#define vl          vector<long long>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (int)x.size()
#define rep(i,a,b)  for(int i=a;i<=b;i++)
#define repl(i,a,b) for(long long i=a;i<=b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define rrepl(i,a,b) for(long long i=a;i>=b;i--)
#define M           1000000007

const int maxn=4e6+100;
vector<pair<pii,int> > q1;
vector<pair<pii,int> > q2;
set<int>s1;
int arr[maxn],st[maxn],st_auxilary[maxn],lazy[maxn];
vi v1;

void build(int si,int l,int r){
    if(l==r){
        st[si]=st_auxilary[si]=arr[l];
        return;
    }
    int mid=l+(r-l)/2;
    build(2*si+1,l,mid);
    build(2*si+2,mid+1,r);
    st[si]=st[2*si+1]+st[2*si+2];
    st_auxilary[si]=st_auxilary[2*si+1]+st_auxilary[2*si+2];
}

void update(int qs,int qe,int ss,int se,int si,int flag){
    //trace4(st[si],si,ss,se);
    if(lazy[si]==1){
        st[si]=0;
        if(ss!=se){
            lazy[2*si+1]=lazy[si];
            lazy[2*si+2]=lazy[si];
        }
        lazy[si]=0;
    }
    else if(lazy[si]==2){
        st[si]=st_auxilary[si];
        if(ss!=se){
            lazy[2*si+1]=lazy[si];
            lazy[2*si+2]=lazy[si];
        }
        lazy[si]=0;
    }
    if(qs>se or ss>qe) return;
    if(ss>=qs and se<=qe){
        if(flag==1) st[si]=0;
        else if(flag==2) st[si]=st_auxilary[si];
        if(ss!=se){
            lazy[2*si+1]=flag;
            lazy[2*si+2]=flag;
        }
        return;
    }
    int mid=ss+(se-ss)/2;
    update(qs,qe,ss,mid,2*si+1,flag);
    update(qs,qe,mid+1,se,2*si+2,flag);
    st[si]=st[2*si+1]+st[2*si+2];
}

void solve(){
    int n,q;
    si(n); si(q);
    s1.insert(1);
    s1.insert(n+1);
    rep(i,1,q){
        int l,r,k;
        si(l); si(r); si(k);
        q1.pb(mp(mp(l,r),k));
        s1.insert(l);
        s1.insert(r+1);
    }
    set<int>::iterator it=s1.begin();
    set<int>::iterator it1=it;
    v1.pb(*it);
    it1++;
    int k=0;
    while(it1!=s1.end()){
        int dif=(*it1)-(*it);
        arr[k]=dif;
        v1.pb(*it1);
        k++;
        it++;
        it1++;
    }
    rep(i,0,sz(q1)-1){
        int pos1=lower_bound(all(v1),q1[i].F.F)-v1.begin();
        int pos2=lower_bound(all(v1),q1[i].F.S+1)-v1.begin();
        pos2--;
        q2.pb(mp(mp(pos1,pos2),q1[i].S));
    }
    build(0,0,k-1);
    //trace1(st[0]);
    rep(i,0,sz(q2)-1){
        update(q2[i].F.F,q2[i].F.S,0,k-1,0,q2[i].S);
        pri(st[0]);
    }
}

int main()
{
    //ios_base::sync_with_stdio(false);
    //cin.tie(NULL);
    //cout.tie(NULL);
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    int t=1;
    //si(t);
    while(t--){
        solve();
    }

    return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define trace1(x)                cerr << #x << ": " << x << endl;
#define trace2(x, y)             cerr << #x << ": " << x << " | " << #y << ": " << y << endl;
#define trace3(x, y, z)          cerr << #x << ": " << x << " | " << #y << ": " << y << " | " << #z << ": " << z << endl;
#define trace4(a, b, c, d)       cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << endl;
#define bitcount    __builtin_popcountll
#define si(x)       scanf("%d",&x)
#define su(x)       scanf("%u",&x)
#define sll(x)      scanf("%lld",&x)
#define sl(x)       scanf("%ld",&x)
#define sc(x)       scanf("%c",&x)
#define ss(x)       scanf("%s",x)
#define sf(x)       scanf("%f",&x)
#define slf(x)      scanf("%lf",&x)
#define pri(x)      printf("%d\n",x)
#define prl(x)      printf("%lld\n",x)
#define ll          long long int
#define pb          push_back
#define mp          make_pair
#define pii         pair<int,int>
#define pll         pair<long long,long long>
#define pil         pair<int,long long>
#define pli         pair<long long,int>
#define vi          vector<int>
#define vl          vector<long long>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (int)x.size()
#define rep(i,a,b)  for(int i=a;i<=b;i++)
#define repl(i,a,b) for(long long i=a;i<=b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define rrepl(i,a,b) for(long long i=a;i>=b;i--)
#define M           1000000007

const int maxn=2e6+100;
vector<pair<pii,int> > q1;
vector<pair<pii,int> > q2;
set<int>s1;
int arr[maxn],st[maxn],st_auxilary[maxn],lazy[maxn];
vi v1;

void build(int si,int l,int r){
    if(l==r){
        st[si]=st_auxilary[si]=arr[l];
        return;
    }
    int mid=l+(r-l)/2;
    build(2*si+1,l,mid);
    build(2*si+2,mid+1,r);
    st[si]=st[2*si+1]+st[2*si+2];
    st_auxilary[si]=st_auxilary[2*si+1]+st_auxilary[2*si+2];
}

void update(int qs,int qe,int ss,int se,int si,int flag){
    //trace4(st[si],si,ss,se);
    if(lazy[si]==1){
        st[si]=0;
        if(ss!=se){
            lazy[2*si+1]=lazy[si];
            lazy[2*si+2]=lazy[si];
        }
        lazy[si]=0;
    }
    else if(lazy[si]==2){
        st[si]=st_auxilary[si];
        if(ss!=se){
            lazy[2*si+1]=lazy[si];
            lazy[2*si+2]=lazy[si];
        }
        lazy[si]=0;
    }
    if(qs>se or ss>qe) return;
    if(ss>=qs and se<=qe){
        if(flag==1) st[si]=0;
        else if(flag==2) st[si]=st_auxilary[si];
        if(ss!=se){
            lazy[2*si+1]=flag;
            lazy[2*si+2]=flag;
        }
        return;
    }
    int mid=ss+(se-ss)/2;
    update(qs,qe,ss,mid,2*si+1,flag);
    update(qs,qe,mid+1,se,2*si+2,flag);
    st[si]=st[2*si+1]+st[2*si+2];
}

void solve(){
    int n,q;
    si(n); si(q);
    s1.insert(1);
    s1.insert(n+1);
    rep(i,1,q){
        int l,r,k;
        si(l); si(r); si(k);
        q1.pb(mp(mp(l,r),k));
        s1.insert(l);
        s1.insert(r+1);
    }
    set<int>::iterator it=s1.begin();
    set<int>::iterator it1=it;
    v1.pb(*it);
    it1++;
    int k=0;
    while(it1!=s1.end()){
        int dif=(*it1)-(*it);
        arr[k]=dif;
        v1.pb(*it1);
        k++;
        it++;
        it1++;
    }
    rep(i,0,sz(q1)-1){
        int pos1=lower_bound(all(v1),q1[i].F.F)-v1.begin();
        int pos2=lower_bound(all(v1),q1[i].F.S+1)-v1.begin();
        pos2--;
        q2.pb(mp(mp(pos1,pos2),q1[i].S));
    }
    build(0,0,k-1);
    //trace1(st[0]);
    rep(i,0,sz(q2)-1){
        update(q2[i].F.F,q2[i].F.S,0,k-1,0,q2[i].S);
        pri(st[0]);
    }
}

int main()
{
    //ios_base::sync_with_stdio(false);
    //cin.tie(NULL);
    //cout.tie(NULL);
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    int t=1;
    //si(t);
    while(t--){
        solve();
    }

    return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define trace1(x)                cerr << #x << ": " << x << endl;
#define trace2(x, y)             cerr << #x << ": " << x << " | " << #y << ": " << y << endl;
#define trace3(x, y, z)          cerr << #x << ": " << x << " | " << #y << ": " << y << " | " << #z << ": " << z << endl;
#define trace4(a, b, c, d)       cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << endl;
#define bitcount    __builtin_popcountll
#define si(x)       scanf("%d",&x)
#define su(x)       scanf("%u",&x)
#define sll(x)      scanf("%lld",&x)
#define sl(x)       scanf("%ld",&x)
#define sc(x)       scanf("%c",&x)
#define ss(x)       scanf("%s",x)
#define sf(x)       scanf("%f",&x)
#define slf(x)      scanf("%lf",&x)
#define pri(x)      printf("%d\n",x)
#define prl(x)      printf("%lld\n",x)
#define ll          long long int
#define pb          push_back
#define mp          make_pair
#define pii         pair<int,int>
#define pll         pair<long long,long long>
#define pil         pair<int,long long>
#define pli         pair<long long,int>
#define vi          vector<int>
#define vl          vector<long long>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (int)x.size()
#define rep(i,a,b)  for(int i=a;i<=b;i++)
#define repl(i,a,b) for(long long i=a;i<=b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define rrepl(i,a,b) for(long long i=a;i>=b;i--)
#define M           1000000007

const int maxn=1e6+100;
int n;

struct node{
    node* left;
    node* right;
    int value,lazy,from,to;
    node(){
        from=1;
        to=n;
        value=0;
        lazy=-1;
        left=NULL;
        right=NULL;
    }
    void extend(){
        if(left==NULL){
            left=new node();
            left->from=from;
            left->to=from+(to-from)/2;
            left->value=0;
        }
        if(right==NULL){
            right=new node();
            right->from=from+(to-from)/2+1;
            right->to=to;
            right->value=0;
        }
    }
};

node* root;

void update(int l,int r,node* cur,int flag){
    if(cur->lazy!=-1){
        cur->value=cur->lazy;
        if(cur->from!=cur->to){
            cur->extend();
            if(!cur->lazy){
                (cur->left)->lazy=0;
                (cur->right)->lazy=0;
            }
            else{
                (cur->left)->lazy=((cur->left)->to)-((cur->left)->from)+1;
                (cur->right)->lazy=((cur->right)->to)-((cur->right)->from)+1;
            }
        }
        cur->lazy=-1;
    }
    if((cur->from)>r or (cur->to)<l) return;
    if((cur->from)>=l and (cur->to)<=r){
        if(flag){
            cur->value=(cur->to)-(cur->from)+1;
            if(cur->from!=cur->to){
                cur->extend();
                (cur->left)->lazy=((cur->left)->to)-((cur->left)->from)+1;
                (cur->right)->lazy=((cur->right)->to)-((cur->right)->from)+1;
            }
        }
        else{
            cur->value=0;
            if(cur->from!=cur->to){
                cur->extend();
                (cur->left)->lazy=0;
                (cur->right)->lazy=0;
            }
        }
        return;
    }
    cur->extend();
    update(l,r,cur->left,flag);
    update(l,r,cur->right,flag);
    cur->value=(cur->left)->value+(cur->right)->value;
}

void solve(){
    int q,l,r,k;
    si(n); si(q);
    root=new node();
    while(q--){
        si(l); si(r); si(k);
        if(k==1) update(l,r,root,1);
        else update(l,r,root,0);
        pri(n-root->value);
    }
}

int main()
{
    //ios_base::sync_with_stdio(false);
    //cin.tie(NULL);
    //cout.tie(NULL);
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    int t=1;
    //si(t);
    while(t--){
        solve();
    }

    return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define trace1(x)                cerr << #x << ": " << x << endl;
#define trace2(x, y)             cerr << #x << ": " << x << " | " << #y << ": " << y << endl;
#define trace3(x, y, z)          cerr << #x << ": " << x << " | " << #y << ": " << y << " | " << #z << ": " << z << endl;
#define trace4(a, b, c, d)       cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << endl;
#define bitcount    __builtin_popcountll
#define si(x)       scanf("%d",&x)
#define su(x)       scanf("%u",&x)
#define sll(x)      scanf("%lld",&x)
#define sl(x)       scanf("%ld",&x)
#define sc(x)       scanf("%c",&x)
#define ss(x)       scanf("%s",x)
#define sf(x)       scanf("%f",&x)
#define slf(x)      scanf("%lf",&x)
#define pri(x)      printf("%d\n",x)
#define prl(x)      printf("%lld\n",x)
#define ll          long long int
#define pb          push_back
#define mp          make_pair
#define pii         pair<int,int>
#define pll         pair<long long,long long>
#define pil         pair<int,long long>
#define pli         pair<long long,int>
#define vi          vector<int>
#define vl          vector<long long>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (int)x.size()
#define rep(i,a,b)  for(int i=a;i<=b;i++)
#define repl(i,a,b) for(long long i=a;i<=b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define rrepl(i,a,b) for(long long i=a;i>=b;i--)
#define M           1000000007

const int maxn=1e6+100;
int n;

struct node{
    node* left;
    node* right;
    int value,lazy,from,to;
    node(){
        from=1;
        to=n;
        value=0;
        lazy=-1;
        left=NULL;
        right=NULL;
    }
    void extend(int param){
        if(left==NULL){
            left=new node();
            left->from=from;
            left->to=from+(to-from)/2;
            left->value=0;
            if(param) left->value=(left->to)-(left->from)+1;
        }
        if(right==NULL){
            right=new node();
            right->from=from+(to-from)/2+1;
            right->to=to;
            right->value=0;
            if(param) right->value=(right->to)-(right->from)+1;
        }
    }
};

node* root;

void update(int l,int r,node* cur,int flag){
    if(cur->lazy!=-1){
        cur->value=cur->lazy;
        if(cur->from!=cur->to){
            if(!cur->lazy){
                if(cur->left!=NULL)
                    (cur->left)->lazy=0;
                if(cur->right!=NULL)
                    (cur->right)->lazy=0;
            }
            else{
                if(cur->left!=NULL)
                    (cur->left)->lazy=((cur->left)->to)-((cur->left)->from)+1;
                if(cur->right!=NULL)
                    (cur->right)->lazy=((cur->right)->to)-((cur->right)->from)+1;
            }
        }
        cur->lazy=-1;
    }
    if((cur->from)>r or (cur->to)<l) return;
    if((cur->from)>=l and (cur->to)<=r){
        if(flag){
            cur->value=(cur->to)-(cur->from)+1;
            if(cur->from!=cur->to){
                if(cur->left!=NULL)
                    (cur->left)->lazy=((cur->left)->to)-((cur->left)->from)+1;
                if(cur->right!=NULL)
                    (cur->right)->lazy=((cur->right)->to)-((cur->right)->from)+1;
            }
        }
        else{
            cur->value=0;
            if(cur->from!=cur->to){
                if(cur->left!=NULL)
                    (cur->left)->lazy=0;
                if(cur->right!=NULL)
                    (cur->right)->lazy=0;
            }
        }
        return;
    }
    cur->extend(cur->value);
    update(l,r,cur->left,flag);
    update(l,r,cur->right,flag);
    cur->value=(cur->left)->value+(cur->right)->value;
}

void solve(){
    int q,l,r,k;
    si(n); si(q);
    root=new node();
    while(q--){
        si(l); si(r); si(k);
        if(k==1) update(l,r,root,1);
        else update(l,r,root,0);
        pri(n-root->value);
    }
}

int main()
{
    //ios_base::sync_with_stdio(false);
    //cin.tie(NULL);
    //cout.tie(NULL);
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    int t=1;
    //si(t);
    while(t--){
        solve();
    }

    return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define trace1(x)                cerr << #x << ": " << x << endl;
#define trace2(x, y)             cerr << #x << ": " << x << " | " << #y << ": " << y << endl;
#define trace3(x, y, z)          cerr << #x << ": " << x << " | " << #y << ": " << y << " | " << #z << ": " << z << endl;
#define trace4(a, b, c, d)       cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << endl;
#define bitcount    __builtin_popcountll
#define si(x)       scanf("%d",&x)
#define su(x)       scanf("%u",&x)
#define sll(x)      scanf("%lld",&x)
#define sl(x)       scanf("%ld",&x)
#define sc(x)       scanf("%c",&x)
#define ss(x)       scanf("%s",x)
#define sf(x)       scanf("%f",&x)
#define slf(x)      scanf("%lf",&x)
#define pri(x)      printf("%d\n",x)
#define prl(x)      printf("%lld\n",x)
#define ll          long long int
#define pb          push_back
#define mp          make_pair
#define pii         pair<int,int>
#define pll         pair<long long,long long>
#define pil         pair<int,long long>
#define pli         pair<long long,int>
#define vi          vector<int>
#define vl          vector<long long>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (int)x.size()
#define rep(i,a,b)  for(int i=a;i<=b;i++)
#define repl(i,a,b) for(long long i=a;i<=b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define rrepl(i,a,b) for(long long i=a;i>=b;i--)
#define M           1000000007

const int maxn=5*1e6+100;
vector<pair<pii,int> > q1;
vector<pair<pii,int> > q2;
set<int>s1;
int arr[maxn],st[maxn],st_auxilary[maxn],lazy[maxn];
vi v1;

void build(int si,int l,int r){
    if(l==r){
        st[si]=st_auxilary[si]=arr[l];
        return;
    }
    int mid=l+(r-l)/2;
    build(2*si+1,l,mid);
    build(2*si+2,mid+1,r);
    st[si]=st[2*si+1]+st[2*si+2];
    st_auxilary[si]=st_auxilary[2*si+1]+st_auxilary[2*si+2];
}

void update(int qs,int qe,int ss,int se,int si,int flag){
    //trace4(st[si],si,ss,se);
    if(lazy[si]==1){
        st[si]=0;
        if(ss!=se){
            lazy[2*si+1]=lazy[si];
            lazy[2*si+2]=lazy[si];
        }
        lazy[si]=0;
    }
    else if(lazy[si]==2){
        st[si]=st_auxilary[si];
        if(ss!=se){
            lazy[2*si+1]=lazy[si];
            lazy[2*si+2]=lazy[si];
        }
        lazy[si]=0;
    }
    if(ss>se or qs>se or ss>qe) return;
    if(ss>=qs and se<=qe){
        if(flag==1) st[si]=0;
        else if(flag==2) st[si]=st_auxilary[si];
        if(ss!=se){
            lazy[2*si+1]=flag;
            lazy[2*si+2]=flag;
        }
        return;
    }
    int mid=(ss+se)>>1;
   if(!((qs>mid or ss>qe) and !lazy[2*si+1]))
        update(qs,qe,ss,mid,2*si+1,flag);
    if(!((qs>se or (mid+1)>qe) and !lazy[2*si+2]))
        update(qs,qe,mid+1,se,2*si+2,flag);
    st[si]=st[2*si+1]+st[2*si+2];
}

void solve(){
    int n,q;
    si(n); si(q);
    s1.insert(1);
    s1.insert(n+1);
    rep(i,1,q){
        int l,r,k;
        si(l); si(r); si(k);
        q1.pb(mp(mp(l,r),k));
        s1.insert(l);
        s1.insert(r+1);
    }
    set<int>::iterator it=s1.begin();
    set<int>::iterator it1=it;
    v1.pb(*it);
    it1++;
    int k=0;
    while(it1!=s1.end()){
        int dif=(*it1)-(*it);
        arr[k]=dif;
        v1.pb(*it1);
        k++;
        it++;
        it1++;
    }

    rep(i,0,q-1){
        int pos1=lower_bound(all(v1),q1[i].F.F)-v1.begin();
        int pos2=lower_bound(all(v1),q1[i].F.S+1)-v1.begin();
        pos2--;
        q2.pb(mp(mp(pos1,pos2),q1[i].S));
    }
    build(0,0,k-1);
    //trace1(st[0]);
    rep(i,0,q-1){
        update(q2[i].F.F,q2[i].F.S,0,k-1,0,q2[i].S);
        printf("%d\n",st[0]);
    }
}

int main()
{
    //ios_base::sync_with_stdio(false);
    //cin.tie(NULL);
    //cout.tie(NULL);
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    int t=1;
    //si(t);
    while(t--){
        solve();
    }

    return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define trace1(x)                cerr << #x << ": " << x << endl;
#define trace2(x, y)             cerr << #x << ": " << x << " | " << #y << ": " << y << endl;
#define trace3(x, y, z)          cerr << #x << ": " << x << " | " << #y << ": " << y << " | " << #z << ": " << z << endl;
#define trace4(a, b, c, d)       cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << endl;
#define bitcount    __builtin_popcountll
#define si(x)       scanf("%d",&x)
#define su(x)       scanf("%u",&x)
#define sll(x)      scanf("%lld",&x)
#define sl(x)       scanf("%ld",&x)
#define sc(x)       scanf("%c",&x)
#define ss(x)       scanf("%s",x)
#define sf(x)       scanf("%f",&x)
#define slf(x)      scanf("%lf",&x)
#define pri(x)      printf("%d\n",x)
#define prl(x)      printf("%lld\n",x)
#define ll          long long int
#define pb          push_back
#define mp          make_pair
#define pii         pair<int,int>
#define pll         pair<long long,long long>
#define pil         pair<int,long long>
#define pli         pair<long long,int>
#define vi          vector<int>
#define vl          vector<long long>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (int)x.size()
#define rep(i,a,b)  for(int i=a;i<=b;i++)
#define repl(i,a,b) for(long long i=a;i<=b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define rrepl(i,a,b) for(long long i=a;i>=b;i--)
#define M           1000000007

const int maxn=4*1e6+100;
vector<pair<pii,int> > q1;
vector<pair<pii,int> > q2;
set<int>s1;
int arr[maxn],st[maxn],st_auxilary[maxn],lazy[maxn];
vi v1;

void build(int si,int l,int r){
    if(l==r){
        st[si]=st_auxilary[si]=arr[l];
        return;
    }
    int mid=l+(r-l)/2;
    build(2*si+1,l,mid);
    build(2*si+2,mid+1,r);
    st[si]=st[2*si+1]+st[2*si+2];
    st_auxilary[si]=st_auxilary[2*si+1]+st_auxilary[2*si+2];
}

void update(int qs,int qe,int ss,int se,int si,int flag){
    //trace4(st[si],si,ss,se);
    if(lazy[si]==1){
        st[si]=0;
        if(ss!=se){
            lazy[2*si+1]=lazy[si];
            lazy[2*si+2]=lazy[si];
        }
        lazy[si]=0;
    }
    else if(lazy[si]==2){
        st[si]=st_auxilary[si];
        if(ss!=se){
            lazy[2*si+1]=lazy[si];
            lazy[2*si+2]=lazy[si];
        }
        lazy[si]=0;
    }
    if(qs>se or ss>qe) return;
    if(ss>=qs and se<=qe){
        if(flag==1) st[si]=0;
        else if(flag==2) st[si]=st_auxilary[si];
        if(ss!=se){
            lazy[2*si+1]=flag;
            lazy[2*si+2]=flag;
        }
        return;
    }
    int mid=ss+(se-ss)/2;
    update(qs,qe,ss,mid,2*si+1,flag);
    update(qs,qe,mid+1,se,2*si+2,flag);
    st[si]=st[2*si+1]+st[2*si+2];
}

void solve(){
    int n,q;
    si(n); si(q);
    s1.insert(1);
    s1.insert(n+1);
    rep(i,1,q){
        int l,r,k;
        si(l); si(r); si(k);
        q1.pb(mp(mp(l,r),k));
        s1.insert(l);
        s1.insert(r+1);
    }
    set<int>::iterator it=s1.begin();
    set<int>::iterator it1=it;
    v1.pb(*it);
    it1++;
    int k=0;
    while(it1!=s1.end()){
        int dif=(*it1)-(*it);
        arr[k]=dif;
        v1.pb(*it1);
        k++;
        it++;
        it1++;
    }

    rep(i,0,q-1){
        int pos1=lower_bound(all(v1),q1[i].F.F)-v1.begin();
        int pos2=lower_bound(all(v1),q1[i].F.S+1)-v1.begin();
        pos2--;
        q2.pb(mp(mp(pos1,pos2),q1[i].S));
    }
    build(0,0,k-1);
    //trace1(st[0]);
    rep(i,0,q-1){
        update(q2[i].F.F,q2[i].F.S,0,k-1,0,q2[i].S);
        printf("%d\n",st[0]);
    }
}

int main()
{
    //ios_base::sync_with_stdio(false);
    //cin.tie(NULL);
    //cout.tie(NULL);
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    int t=1;
    //si(t);
    while(t--){
        solve();
    }

    return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define trace1(x)                cerr << #x << ": " << x << endl;
#define trace2(x, y)             cerr << #x << ": " << x << " | " << #y << ": " << y << endl;
#define trace3(x, y, z)          cerr << #x << ": " << x << " | " << #y << ": " << y << " | " << #z << ": " << z << endl;
#define trace4(a, b, c, d)       cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << endl;
#define bitcount    __builtin_popcountll
#define si(x)       scanf("%d",&x)
#define su(x)       scanf("%u",&x)
#define sll(x)      scanf("%lld",&x)
#define sl(x)       scanf("%ld",&x)
#define sc(x)       scanf("%c",&x)
#define ss(x)       scanf("%s",x)
#define sf(x)       scanf("%f",&x)
#define slf(x)      scanf("%lf",&x)
#define pri(x)      printf("%d\n",x)
#define prl(x)      printf("%lld\n",x)
#define ll          long long int
#define pb          push_back
#define mp          make_pair
#define pii         pair<int,int>
#define pll         pair<long long,long long>
#define pil         pair<int,long long>
#define pli         pair<long long,int>
#define vi          vector<int>
#define vl          vector<long long>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (int)x.size()
#define rep(i,a,b)  for(int i=a;i<=b;i++)
#define repl(i,a,b) for(long long i=a;i<=b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define rrepl(i,a,b) for(long long i=a;i>=b;i--)
#define M           1000000007

const int maxn=3*1e6+100;
vector<pair<pii,int> > q1;
vector<pair<pii,int> > q2;
set<int>s1;
int arr[maxn],st[maxn],st_auxilary[maxn],lazy[maxn];
vi v1;

void build(int si,int l,int r){
    if(l==r){
        st[si]=st_auxilary[si]=arr[l];
        return;
    }
    int mid=(l+r)>>1;
    build(2*si+1,l,mid);
    build(2*si+2,mid+1,r);
    st[si]=st[2*si+1]+st[2*si+2];
    st_auxilary[si]=st_auxilary[2*si+1]+st_auxilary[2*si+2];
}

void update(int qs,int qe,int ss,int se,int si,int flag){
    //trace4(st[si],si,ss,se);
    if(lazy[si]==1){
        st[si]=0;
        if(ss!=se){
            lazy[2*si+1]=lazy[si];
            lazy[2*si+2]=lazy[si];
        }
        lazy[si]=0;
    }
    else if(lazy[si]==2){
        st[si]=st_auxilary[si];
        if(ss!=se){
            lazy[2*si+1]=lazy[si];
            lazy[2*si+2]=lazy[si];
        }
        lazy[si]=0;
    }
    if(ss>se or qs>se or ss>qe) return;
    if(ss>=qs and se<=qe){
        if(flag==1) st[si]=0;
        else if(flag==2) st[si]=st_auxilary[si];
        if(ss!=se){
            lazy[2*si+1]=flag;
            lazy[2*si+2]=flag;
        }
        return;
    }
    int mid=(ss+se)>>1;
   if(!((qs>mid or ss>qe) and !lazy[2*si+1]))
        update(qs,qe,ss,mid,2*si+1,flag);
    if(!((qs>se or (mid+1)>qe) and !lazy[2*si+2]))
        update(qs,qe,mid+1,se,2*si+2,flag);
    st[si]=st[2*si+1]+st[2*si+2];
}

void solve(){
    int n,q;
    scanf("%d",&n);
    scanf("%d",&q);
    s1.insert(1);
    s1.insert(n+1);
    for(int i=1;i<=q;i++){
        int l,r,k;
        scanf("%d %d %d",&l,&r,&k);
        q1.push_back({{l,r},k});
        s1.insert(l);
        s1.insert(r+1);
    }
    set<int>::iterator it=s1.begin();
    set<int>::iterator it1=it;
    v1.pb(*it);
    it1++;
    int k=0;
    while(it1!=s1.end()){
        int dif=(*it1)-(*it);
        arr[k]=dif;
        v1.push_back(*it1);
        k++;
        it++;
        it1++;
    }

    for(int i=0;i<q;i++){
        int pos1=lower_bound(all(v1),q1[i].first.first)-v1.begin();
        int pos2=lower_bound(all(v1),q1[i].first.second+1)-v1.begin();
        pos2--;
        q2.push_back({{pos1,pos2},q1[i].second});
    }
    build(0,0,k-1);
    //trace1(st[0]);
    for(int i=0;i<q;i++){
        update(q2[i].F.F,q2[i].first.second,0,k-1,0,q2[i].second);
        printf("%d\n",st[0]);
    }
}

int main()
{
    //ios_base::sync_with_stdio(false);
    //cin.tie(NULL);
    //cout.tie(NULL);
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    int t=1;
    //si(t);
    while(t--){
        solve();
    }

    return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define trace1(x)                cerr << #x << ": " << x << endl;
#define trace2(x, y)             cerr << #x << ": " << x << " | " << #y << ": " << y << endl;
#define trace3(x, y, z)          cerr << #x << ": " << x << " | " << #y << ": " << y << " | " << #z << ": " << z << endl;
#define trace4(a, b, c, d)       cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << endl;
#define bitcount    __builtin_popcountll
#define si(x)       scanf("%d",&x)
#define su(x)       scanf("%u",&x)
#define sll(x)      scanf("%lld",&x)
#define sl(x)       scanf("%ld",&x)
#define sc(x)       scanf("%c",&x)
#define ss(x)       scanf("%s",x)
#define sf(x)       scanf("%f",&x)
#define slf(x)      scanf("%lf",&x)
#define pri(x)      printf("%d\n",x)
#define prl(x)      printf("%lld\n",x)
#define ll          long long int
#define pb          push_back
#define mp          make_pair
#define pii         pair<int,int>
#define pll         pair<long long,long long>
#define pil         pair<int,long long>
#define pli         pair<long long,int>
#define vi          vector<int>
#define vl          vector<long long>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (int)x.size()
#define rep(i,a,b)  for(int i=a;i<=b;i++)
#define repl(i,a,b) for(long long i=a;i<=b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define rrepl(i,a,b) for(long long i=a;i>=b;i--)
#define M           1000000007

const int maxn=3*1e6+100;
vector<pair<pii,int> > q1;
vector<pair<pii,int> > q2;
set<int>s1;
int arr[maxn],st[maxn],st_auxilary[maxn],lazy[maxn];
vi v1;

void build(int si,int l,int r){
    if(l==r){
        st[si]=st_auxilary[si]=arr[l];
        return;
    }
    int mid=(l+r)>>1;
    build(2*si+1,l,mid);
    build(2*si+2,mid+1,r);
    st[si]=st[2*si+1]+st[2*si+2];
    st_auxilary[si]=st_auxilary[2*si+1]+st_auxilary[2*si+2];
}

void update(int qs,int qe,int ss,int se,int si,int flag){
    //trace4(st[si],si,ss,se);
    if(lazy[si]==1){
        st[si]=0;
        if(ss!=se){
            lazy[2*si+1]=lazy[si];
            lazy[2*si+2]=lazy[si];
        }
        lazy[si]=0;
    }
    else if(lazy[si]==2){
        st[si]=st_auxilary[si];
        if(ss!=se){
            lazy[2*si+1]=lazy[si];
            lazy[2*si+2]=lazy[si];
        }
        lazy[si]=0;
    }
    if(ss>se or qs>se or ss>qe) return;
    if(ss>=qs and se<=qe){
        if(flag==1) st[si]=0;
        else if(flag==2) st[si]=st_auxilary[si];
        if(ss!=se){
            lazy[2*si+1]=flag;
            lazy[2*si+2]=flag;
        }
        return;
    }
    int mid=(ss+se)>>1;
   if(!((qs>mid or ss>qe) and !lazy[2*si+1]))
        update(qs,qe,ss,mid,2*si+1,flag);
    if(!((qs>se or (mid+1)>qe) and !lazy[2*si+2]))
        update(qs,qe,mid+1,se,2*si+2,flag);
    st[si]=st[2*si+1]+st[2*si+2];
}

void solve(){
    int n,q;
    si(n); si(q);
    s1.insert(1);
    s1.insert(n+1);
    rep(i,1,q){
        int l,r,k;
        si(l); si(r); si(k);
        q1.pb(mp(mp(l,r),k));
        s1.insert(l);
        s1.insert(r+1);
    }
    set<int>::iterator it=s1.begin();
    set<int>::iterator it1=it;
    v1.pb(*it);
    it1++;
    int k=0;
    while(it1!=s1.end()){
        int dif=(*it1)-(*it);
        arr[k]=dif;
        v1.pb(*it1);
        k++;
        it++;
        it1++;
    }

    rep(i,0,q-1){
        int pos1=lower_bound(all(v1),q1[i].F.F)-v1.begin();
        int pos2=lower_bound(all(v1),q1[i].F.S+1)-v1.begin();
        pos2--;
        q2.pb(mp(mp(pos1,pos2),q1[i].S));
    }
    build(0,0,k-1);
    //trace1(st[0]);
    rep(i,0,q-1){
        update(q2[i].F.F,q2[i].F.S,0,k-1,0,q2[i].S);
        printf("%d\n",st[0]);
    }
}

int main()
{
    //ios_base::sync_with_stdio(false);
    //cin.tie(NULL);
    //cout.tie(NULL);
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    int t=1;
    //si(t);
    while(t--){
        solve();
    }

    return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define trace1(x)                cerr << #x << ": " << x << endl;
#define trace2(x, y)             cerr << #x << ": " << x << " | " << #y << ": " << y << endl;
#define trace3(x, y, z)          cerr << #x << ": " << x << " | " << #y << ": " << y << " | " << #z << ": " << z << endl;
#define trace4(a, b, c, d)       cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << endl;
#define bitcount    __builtin_popcountll
#define si(x)       scanf("%d",&x)
#define su(x)       scanf("%u",&x)
#define sll(x)      scanf("%lld",&x)
#define sl(x)       scanf("%ld",&x)
#define sc(x)       scanf("%c",&x)
#define ss(x)       scanf("%s",x)
#define sf(x)       scanf("%f",&x)
#define slf(x)      scanf("%lf",&x)
#define pri(x)      printf("%d\n",x)
#define prl(x)      printf("%lld\n",x)
#define ll          long long int
#define pb          push_back
#define mp          make_pair
#define pii         pair<int,int>
#define pll         pair<long long,long long>
#define pil         pair<int,long long>
#define pli         pair<long long,int>
#define vi          vector<int>
#define vl          vector<long long>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (int)x.size()
#define rep(i,a,b)  for(int i=a;i<=b;i++)
#define repl(i,a,b) for(long long i=a;i<=b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define rrepl(i,a,b) for(long long i=a;i>=b;i--)
#define M           1000000007

const int maxn=4*1e6+100;
vector<pair<pii,int> > q1;
vector<pair<pii,int> > q2;
set<int>s1;
int arr[maxn],st[maxn],st_auxilary[maxn],lazy[maxn];
vi v1;

void build(int si,int l,int r){
    if(l==r){
        st[si]=st_auxilary[si]=arr[l];
        return;
    }
    int mid=(l+r)>>1;
    build(2*si+1,l,mid);
    build(2*si+2,mid+1,r);
    st[si]=st[2*si+1]+st[2*si+2];
    st_auxilary[si]=st_auxilary[2*si+1]+st_auxilary[2*si+2];
}

void update(int qs,int qe,int ss,int se,int si,int flag){
    //trace4(st[si],si,ss,se);
    if(lazy[si]==1){
        st[si]=0;
        if(ss!=se){
            lazy[2*si+1]=lazy[si];
            lazy[2*si+2]=lazy[si];
        }
        lazy[si]=0;
    }
    else if(lazy[si]==2){
        st[si]=st_auxilary[si];
        if(ss!=se){
            lazy[2*si+1]=lazy[si];
            lazy[2*si+2]=lazy[si];
        }
        lazy[si]=0;
    }
    if(ss>se or qs>se or ss>qe) return;
    if(ss>=qs and se<=qe){
        if(flag==1) st[si]=0;
        else if(flag==2) st[si]=st_auxilary[si];
        if(ss!=se){
            lazy[2*si+1]=flag;
            lazy[2*si+2]=flag;
        }
        return;
    }
    int mid=(ss+se)>>1;
   if(!((qs>mid or ss>qe) and !lazy[2*si+1]))
        update(qs,qe,ss,mid,2*si+1,flag);
    if(!((qs>se or (mid+1)>qe) and !lazy[2*si+2]))
        update(qs,qe,mid+1,se,2*si+2,flag);
    st[si]=st[2*si+1]+st[2*si+2];
}

void solve(){
    int n,q;
    scanf("%d",&n);
    scanf("%d",&q);
    s1.insert(1);
    s1.insert(n+1);
    for(int i=1;i<=q;i++){
        int l,r,k;
        scanf("%d %d %d",&l,&r,&k);
        q1.push_back({{l,r},k});
        s1.insert(l);
        s1.insert(r+1);
    }
    set<int>::iterator it=s1.begin();
    set<int>::iterator it1=it;
    v1.pb(*it);
    it1++;
    int k=0;
    while(it1!=s1.end()){
        int dif=(*it1)-(*it);
        arr[k]=dif;
        v1.push_back(*it1);
        k++;
        it++;
        it1++;
    }

    for(int i=0;i<q;i++){
        int pos1=lower_bound(all(v1),q1[i].first.first)-v1.begin();
        int pos2=lower_bound(all(v1),q1[i].first.second+1)-v1.begin();
        pos2--;
        q2.push_back({{pos1,pos2},q1[i].second});
    }
    build(0,0,k-1);
    //trace1(st[0]);
    for(int i=0;i<q;i++){
        update(q2[i].F.F,q2[i].first.second,0,k-1,0,q2[i].second);
        printf("%d\n",st[0]);
    }
}

int main()
{
    //ios_base::sync_with_stdio(false);
    //cin.tie(NULL);
    //cout.tie(NULL);
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    int t=1;
    //si(t);
    while(t--){
        solve();
    }

    return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define trace1(x)                cerr << #x << ": " << x << endl;
#define trace2(x, y)             cerr << #x << ": " << x << " | " << #y << ": " << y << endl;
#define trace3(x, y, z)          cerr << #x << ": " << x << " | " << #y << ": " << y << " | " << #z << ": " << z << endl;
#define trace4(a, b, c, d)       cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << endl;
#define bitcount    __builtin_popcountll
#define si(x)       scanf("%d",&x)
#define su(x)       scanf("%u",&x)
#define sll(x)      scanf("%lld",&x)
#define sl(x)       scanf("%ld",&x)
#define sc(x)       scanf("%c",&x)
#define ss(x)       scanf("%s",x)
#define sf(x)       scanf("%f",&x)
#define slf(x)      scanf("%lf",&x)
#define pri(x)      printf("%d\n",x)
#define prl(x)      printf("%lld\n",x)
#define ll          long long int
#define pb          push_back
#define mp          make_pair
#define pii         pair<int,int>
#define pll         pair<long long,long long>
#define pil         pair<int,long long>
#define pli         pair<long long,int>
#define vi          vector<int>
#define vl          vector<long long>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (int)x.size()
#define rep(i,a,b)  for(int i=a;i<=b;i++)
#define repl(i,a,b) for(long long i=a;i<=b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define rrepl(i,a,b) for(long long i=a;i>=b;i--)
#define M           1000000007

const int maxn=2*1e6+100;
vector<pair<pii,int> > q1;
vector<pair<pii,int> > q2;
set<int>s1;
int arr[maxn],st[maxn],st_auxilary[maxn],lazy[maxn];
vi v1;

void build(int si,int l,int r){
    if(l==r){
        st[si]=st_auxilary[si]=arr[l];
        return;
    }
    int mid=l+(r-l)/2;
    build(2*si+1,l,mid);
    build(2*si+2,mid+1,r);
    st[si]=st[2*si+1]+st[2*si+2];
    st_auxilary[si]=st_auxilary[2*si+1]+st_auxilary[2*si+2];
}

void update(int qs,int qe,int ss,int se,int si,int flag){
    //trace4(st[si],si,ss,se);
    if(lazy[si]==1){
        st[si]=0;
        if(ss!=se){
            lazy[2*si+1]=lazy[si];
            lazy[2*si+2]=lazy[si];
        }
        lazy[si]=0;
    }
    else if(lazy[si]==2){
        st[si]=st_auxilary[si];
        if(ss!=se){
            lazy[2*si+1]=lazy[si];
            lazy[2*si+2]=lazy[si];
        }
        lazy[si]=0;
    }
    if(ss>se or qs>se or ss>qe) return;
    if(ss>=qs and se<=qe){
        if(flag==1) st[si]=0;
        else if(flag==2) st[si]=st_auxilary[si];
        if(ss!=se){
            lazy[2*si+1]=flag;
            lazy[2*si+2]=flag;
        }
        return;
    }
    int mid=(ss+se)>>1;
   if(!((qs>mid or ss>qe) and !lazy[2*si+1]))
        update(qs,qe,ss,mid,2*si+1,flag);
    if(!((qs>se or (mid+1)>qe) and !lazy[2*si+2]))
        update(qs,qe,mid+1,se,2*si+2,flag);
    st[si]=st[2*si+1]+st[2*si+2];
}

void solve(){
    int n,q;
    si(n); si(q);
    s1.insert(1);
    s1.insert(n+1);
    rep(i,1,q){
        int l,r,k;
        si(l); si(r); si(k);
        q1.pb(mp(mp(l,r),k));
        s1.insert(l);
        s1.insert(r+1);
    }
    set<int>::iterator it=s1.begin();
    set<int>::iterator it1=it;
    v1.pb(*it);
    it1++;
    int k=0;
    while(it1!=s1.end()){
        int dif=(*it1)-(*it);
        arr[k]=dif;
        v1.pb(*it1);
        k++;
        it++;
        it1++;
    }

    rep(i,0,q-1){
        int pos1=lower_bound(all(v1),q1[i].F.F)-v1.begin();
        int pos2=lower_bound(all(v1),q1[i].F.S+1)-v1.begin();
        pos2--;
        q2.pb(mp(mp(pos1,pos2),q1[i].S));
    }
    build(0,0,k-1);
    //trace1(st[0]);
    rep(i,0,q-1){
        update(q2[i].F.F,q2[i].F.S,0,k-1,0,q2[i].S);
        printf("%d\n",st[0]);
    }
}

int main()
{
    //ios_base::sync_with_stdio(false);
    //cin.tie(NULL);
    //cout.tie(NULL);
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    int t=1;
    //si(t);
    while(t--){
        solve();
    }

    return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define trace1(x)                cerr << #x << ": " << x << endl;
#define trace2(x, y)             cerr << #x << ": " << x << " | " << #y << ": " << y << endl;
#define trace3(x, y, z)          cerr << #x << ": " << x << " | " << #y << ": " << y << " | " << #z << ": " << z << endl;
#define trace4(a, b, c, d)       cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << endl;
#define bitcount    __builtin_popcountll
#define si(x)       scanf("%d",&x)
#define su(x)       scanf("%u",&x)
#define sll(x)      scanf("%lld",&x)
#define sl(x)       scanf("%ld",&x)
#define sc(x)       scanf("%c",&x)
#define ss(x)       scanf("%s",x)
#define sf(x)       scanf("%f",&x)
#define slf(x)      scanf("%lf",&x)
#define pri(x)      printf("%d\n",x)
#define prl(x)      printf("%lld\n",x)
#define ll          long long int
#define pb          push_back
#define mp          make_pair
#define pii         pair<int,int>
#define pll         pair<long long,long long>
#define pil         pair<int,long long>
#define pli         pair<long long,int>
#define vi          vector<int>
#define vl          vector<long long>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (int)x.size()
#define rep(i,a,b)  for(int i=a;i<=b;i++)
#define repl(i,a,b) for(long long i=a;i<=b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define rrepl(i,a,b) for(long long i=a;i>=b;i--)
#define M           1000000007

const int maxn=5*1e6+100;
vector<pair<pii,int> > q1;
vector<pair<pii,int> > q2;
set<int>s1;
int arr[maxn],st[maxn],st_auxilary[maxn],lazy[maxn];
vi v1;

void build(int si,int l,int r){
    if(l==r){
        st[si]=st_auxilary[si]=arr[l];
        return;
    }
    int mid=(l+r)>>1;
    build(2*si+1,l,mid);
    build(2*si+2,mid+1,r);
    st[si]=st[2*si+1]+st[2*si+2];
    st_auxilary[si]=st_auxilary[2*si+1]+st_auxilary[2*si+2];
}

void update(int qs,int qe,int ss,int se,int si,int flag){
    //trace4(st[si],si,ss,se);
    if(lazy[si]==1){
        st[si]=0;
        if(ss!=se){
            lazy[2*si+1]=lazy[si];
            lazy[2*si+2]=lazy[si];
        }
        lazy[si]=0;
    }
    else if(lazy[si]==2){
        st[si]=st_auxilary[si];
        if(ss!=se){
            lazy[2*si+1]=lazy[si];
            lazy[2*si+2]=lazy[si];
        }
        lazy[si]=0;
    }
    if(ss>se or qs>se or ss>qe) return;
    if(ss>=qs and se<=qe){
        if(flag==1) st[si]=0;
        else if(flag==2) st[si]=st_auxilary[si];
        if(ss!=se){
            lazy[2*si+1]=flag;
            lazy[2*si+2]=flag;
        }
        return;
    }
    int mid=(ss+se)>>1;
   if(!((qs>mid or ss>qe) and !lazy[2*si+1]))
        update(qs,qe,ss,mid,2*si+1,flag);
    if(!((qs>se or (mid+1)>qe) and !lazy[2*si+2]))
        update(qs,qe,mid+1,se,2*si+2,flag);
    st[si]=st[2*si+1]+st[2*si+2];
}

void solve(){
    int n,q;
    scanf("%d",&n);
    scanf("%d",&q);
    s1.insert(1);
    s1.insert(n+1);
    for(int i=1;i<=q;i++){
        int l,r,k;
        scanf("%d %d %d",&l,&r,&k);
        q1.push_back({{l,r},k});
        s1.insert(l);
        s1.insert(r+1);
    }
    set<int>::iterator it=s1.begin();
    set<int>::iterator it1=it;
    v1.pb(*it);
    it1++;
    int k=0;
    while(it1!=s1.end()){
        int dif=(*it1)-(*it);
        arr[k]=dif;
        v1.push_back(*it1);
        k++;
        it++;
        it1++;
    }

    for(int i=0;i<q;i++){
        int pos1=lower_bound(all(v1),q1[i].first.first)-v1.begin();
        int pos2=lower_bound(all(v1),q1[i].first.second+1)-v1.begin();
        pos2--;
        q2.push_back({{pos1,pos2},q1[i].second});
    }
    build(0,0,k-1);
    //trace1(st[0]);
    for(int i=0;i<q;i++){
        update(q2[i].F.F,q2[i].first.second,0,k-1,0,q2[i].second);
        printf("%d\n",st[0]);
    }
}

int main()
{
    //ios_base::sync_with_stdio(false);
    //cin.tie(NULL);
    //cout.tie(NULL);
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    int t=1;
    //si(t);
    while(t--){
        solve();
    }

    return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define trace1(x)                cerr << #x << ": " << x << endl;
#define trace2(x, y)             cerr << #x << ": " << x << " | " << #y << ": " << y << endl;
#define trace3(x, y, z)          cerr << #x << ": " << x << " | " << #y << ": " << y << " | " << #z << ": " << z << endl;
#define trace4(a, b, c, d)       cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << endl;
#define bitcount    __builtin_popcountll
#define si(x)       scanf("%d",&x)
#define su(x)       scanf("%u",&x)
#define sll(x)      scanf("%lld",&x)
#define sl(x)       scanf("%ld",&x)
#define sc(x)       scanf("%c",&x)
#define ss(x)       scanf("%s",x)
#define sf(x)       scanf("%f",&x)
#define slf(x)      scanf("%lf",&x)
#define pri(x)      printf("%d\n",x)
#define prl(x)      printf("%lld\n",x)
#define ll          long long int
#define pb          push_back
#define mp          make_pair
#define pii         pair<int,int>
#define pll         pair<long long,long long>
#define pil         pair<int,long long>
#define pli         pair<long long,int>
#define vi          vector<int>
#define vl          vector<long long>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (int)x.size()
#define rep(i,a,b)  for(int i=a;i<=b;i++)
#define repl(i,a,b) for(long long i=a;i<=b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define rrepl(i,a,b) for(long long i=a;i>=b;i--)
#define M           1000000007

const int maxn=4*1e6+100;
vector<pair<pii,int> > q1;
vector<pair<pii,int> > q2;
set<int>s1;
int arr[maxn],st[maxn],st_auxilary[maxn],lazy[maxn];
vi v1;

void build(int si,int l,int r){
    if(l==r){
        st[si]=st_auxilary[si]=arr[l];
        return;
    }
    int mid=l+(r-l)/2;
    build(2*si+1,l,mid);
    build(2*si+2,mid+1,r);
    st[si]=st[2*si+1]+st[2*si+2];
    st_auxilary[si]=st_auxilary[2*si+1]+st_auxilary[2*si+2];
}

void update(int qs,int qe,int ss,int se,int si,int flag){
    //trace4(st[si],si,ss,se);
    if(lazy[si]==1){
        st[si]=0;
        if(ss!=se){
            lazy[2*si+1]=lazy[si];
            lazy[2*si+2]=lazy[si];
        }
        lazy[si]=0;
    }
    else if(lazy[si]==2){
        st[si]=st_auxilary[si];
        if(ss!=se){
            lazy[2*si+1]=lazy[si];
            lazy[2*si+2]=lazy[si];
        }
        lazy[si]=0;
    }
    if(ss>se or qs>se or ss>qe) return;
    if(ss>=qs and se<=qe){
        if(flag==1) st[si]=0;
        else if(flag==2) st[si]=st_auxilary[si];
        if(ss!=se){
            lazy[2*si+1]=flag;
            lazy[2*si+2]=flag;
        }
        return;
    }
    int mid=(ss+se)>>1;
   if(!((qs>mid or ss>qe) and !lazy[2*si+1]))
        update(qs,qe,ss,mid,2*si+1,flag);
    if(!((qs>se or (mid+1)>qe) and !lazy[2*si+2]))
        update(qs,qe,mid+1,se,2*si+2,flag);
    st[si]=st[2*si+1]+st[2*si+2];
}

void solve(){
    int n,q;
    si(n); si(q);
    s1.insert(1);
    s1.insert(n+1);
    rep(i,1,q){
        int l,r,k;
        si(l); si(r); si(k);
        q1.pb(mp(mp(l,r),k));
        s1.insert(l);
        s1.insert(r+1);
    }
    set<int>::iterator it=s1.begin();
    set<int>::iterator it1=it;
    v1.pb(*it);
    it1++;
    int k=0;
    while(it1!=s1.end()){
        int dif=(*it1)-(*it);
        arr[k]=dif;
        v1.pb(*it1);
        k++;
        it++;
        it1++;
    }

    rep(i,0,q-1){
        int pos1=lower_bound(all(v1),q1[i].F.F)-v1.begin();
        int pos2=lower_bound(all(v1),q1[i].F.S+1)-v1.begin();
        pos2--;
        q2.pb(mp(mp(pos1,pos2),q1[i].S));
    }
    build(0,0,k-1);
    //trace1(st[0]);
    rep(i,0,q-1){
        update(q2[i].F.F,q2[i].F.S,0,k-1,0,q2[i].S);
        printf("%d\n",st[0]);
    }
}

int main()
{
    //ios_base::sync_with_stdio(false);
    //cin.tie(NULL);
    //cout.tie(NULL);
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    int t=1;
    //si(t);
    while(t--){
        solve();
    }

    return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define trace1(x)                cerr << #x << ": " << x << endl;
#define trace2(x, y)             cerr << #x << ": " << x << " | " << #y << ": " << y << endl;
#define trace3(x, y, z)          cerr << #x << ": " << x << " | " << #y << ": " << y << " | " << #z << ": " << z << endl;
#define trace4(a, b, c, d)       cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << endl;
#define bitcount    __builtin_popcountll
#define si(x)       scanf("%d",&x)
#define su(x)       scanf("%u",&x)
#define sll(x)      scanf("%lld",&x)
#define sl(x)       scanf("%ld",&x)
#define sc(x)       scanf("%c",&x)
#define ss(x)       scanf("%s",x)
#define sf(x)       scanf("%f",&x)
#define slf(x)      scanf("%lf",&x)
#define pri(x)      printf("%d\n",x)
#define prl(x)      printf("%lld\n",x)
#define ll          long long int
#define pb          push_back
#define mp          make_pair
#define pii         pair<int,int>
#define pll         pair<long long,long long>
#define pil         pair<int,long long>
#define pli         pair<long long,int>
#define vi          vector<int>
#define vl          vector<long long>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (int)x.size()
#define rep(i,a,b)  for(int i=a;i<=b;i++)
#define repl(i,a,b) for(long long i=a;i<=b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define rrepl(i,a,b) for(long long i=a;i>=b;i--)
#define M           1000000007

const int maxn=4e6+100;
vector<pair<pii,int> > q1;
vector<pair<pii,int> > q2;
set<int>s1;
int arr[maxn],st[maxn],st_auxilary[maxn],lazy[maxn];
vi v1;

void build(int si,int l,int r){
    if(l==r){
        st[si]=st_auxilary[si]=arr[l];
        return;
    }
    int mid=l+(r-l)/2;
    build(2*si+1,l,mid);
    build(2*si+2,mid+1,r);
    st[si]=st[2*si+1]+st[2*si+2];
    st_auxilary[si]=st_auxilary[2*si+1]+st_auxilary[2*si+2];
}

void update(int qs,int qe,int ss,int se,int si,int flag){
    //trace4(st[si],si,ss,se);
    if(lazy[si]==1){
        st[si]=0;
        if(ss!=se){
            lazy[2*si+1]=lazy[si];
            lazy[2*si+2]=lazy[si];
        }
        lazy[si]=0;
    }
    else if(lazy[si]==2){
        st[si]=st_auxilary[si];
        if(ss!=se){
            lazy[2*si+1]=lazy[si];
            lazy[2*si+2]=lazy[si];
        }
        lazy[si]=0;
    }
    if(qs>se or ss>qe) return;
    if(ss>=qs and se<=qe){
        if(flag==1) st[si]=0;
        else if(flag==2) st[si]=st_auxilary[si];
        if(ss!=se){
            lazy[2*si+1]=flag;
            lazy[2*si+2]=flag;
        }
        return;
    }
    int mid=ss+(se-ss)/2;
    if(!(qs>mid or ss>qe))
        update(qs,qe,ss,mid,2*si+1,flag);
    if(!(qs>se or (mid+1)>qs))
        update(qs,qe,mid+1,se,2*si+2,flag);
    st[si]=st[2*si+1]+st[2*si+2];
}

void solve(){
    int n,q;
    si(n); si(q);
    s1.insert(1);
    s1.insert(n+1);
    rep(i,1,q){
        int l,r,k;
        si(l); si(r); si(k);
        q1.pb(mp(mp(l,r),k));
        s1.insert(l);
        s1.insert(r+1);
    }
    auto it=s1.begin();
    auto it1=s1.begin();
    v1.pb(*it);
    it1++;
    int k=0;
    while(it1!=s1.end()){
        int dif=(*it1)-(*it);
        arr[k]=dif;
        v1.pb(*it1);
        k++;
        it++;
        it1++;
    }
    rep(i,0,sz(q1)-1){
        int pos1=lower_bound(all(v1),q1[i].F.F)-v1.begin();
        int pos2=lower_bound(all(v1),q1[i].F.S+1)-v1.begin();
        pos2--;
        q2.pb(mp(mp(pos1,pos2),q1[i].S));
    }
    build(0,0,k-1);
    //trace1(st[0]);
    rep(i,0,sz(q2)-1){
        update(q2[i].F.F,q2[i].F.S,0,k-1,0,q2[i].S);
        pri(st[0]);
    }
}

int main()
{
    //ios_base::sync_with_stdio(false);
    //cin.tie(NULL);
    //cout.tie(NULL);
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    int t=1;
    //si(t);
    while(t--){
        solve();
    }

    return 0;
}


#include <bits/stdc++.h>
using namespace std;

const int maxn=3*1e6+100;
vector<pair<pair<int,int>,int> > q1;
vector<pair<pair<int,int>,int> > q2;
set<int>s1;
int arr[maxn],st[maxn],st_auxilary[maxn],lazy[maxn];
vector<int> v1;

void build(int si,int l,int r){
    if(l==r){
        st[si]=st_auxilary[si]=arr[l];
        return;
    }
    int mid=(l+r)>>1;
    build(2*si+1,l,mid);
    build(2*si+2,mid+1,r);
    st[si]=st[2*si+1]+st[2*si+2];
    st_auxilary[si]=st_auxilary[2*si+1]+st_auxilary[2*si+2];
}

void update(int qs,int qe,int ss,int se,int si,int flag){
    //trace4(st[si],si,ss,se);
    if(lazy[si]==1){
        st[si]=0;
        if(ss!=se){
            lazy[2*si+1]=lazy[si];
            lazy[2*si+2]=lazy[si];
        }
        lazy[si]=0;
    }
    else if(lazy[si]==2){
        st[si]=st_auxilary[si];
        if(ss!=se){
            lazy[2*si+1]=lazy[si];
            lazy[2*si+2]=lazy[si];
        }
        lazy[si]=0;
    }
    if(ss>se or qs>se or ss>qe) return;
    if(ss>=qs and se<=qe){
        if(flag==1) st[si]=0;
        else if(flag==2) st[si]=st_auxilary[si];
        if(ss!=se){
            lazy[2*si+1]=flag;
            lazy[2*si+2]=flag;
        }
        return;
    }
    int mid=(ss+se)>>1;
   //if(!((qs>mid or ss>qe) and !lazy[2*si+1]))
        update(qs,qe,ss,mid,2*si+1,flag);
    //if(!((qs>se or (mid+1)>qe) and !lazy[2*si+2]))
        update(qs,qe,mid+1,se,2*si+2,flag);
    st[si]=st[2*si+1]+st[2*si+2];
}

void solve(){
    int n,q;
    scanf("%d",&n);
    scanf("%d",&q);
    s1.insert(1);
    s1.insert(n+1);
    for(int i=1;i<=q;i++){
        int l,r,k;
        scanf("%d %d %d",&l,&r,&k);
        q1.push_back({{l,r},k});
        s1.insert(l);
        s1.insert(r+1);
    }
    set<int>::iterator it=s1.begin();
    set<int>::iterator it1=it;
    v1.push_back(*it);
    it1++;
    int k=0;
    while(it1!=s1.end()){
        int dif=(*it1)-(*it);
        arr[k]=dif;
        v1.push_back(*it1);
        k++;
        it++;
        it1++;
    }

    for(int i=0;i<q;i++){
        int pos1=lower_bound(v1.begin(),v1.end(),q1[i].first.first)-v1.begin();
        int pos2=lower_bound(v1.begin(),v1.end(),q1[i].first.second+1)-v1.begin();
        pos2--;
        q2.push_back({{pos1,pos2},q1[i].second});
    }
    build(0,0,k-1);
    //trace1(st[0]);
    for(int i=0;i<q;i++){
        update(q2[i].first.first,q2[i].first.second,0,k-1,0,q2[i].second);
        printf("%d\n",st[0]);
    }
}

int main()
{
    //ios_base::sync_with_stdio(false);
    //cin.tie(NULL);
    //cout.tie(NULL);
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    int t=1;
    //si(t);
    while(t--){
        solve();
    }

    return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define trace1(x)                cerr << #x << ": " << x << endl;
#define trace2(x, y)             cerr << #x << ": " << x << " | " << #y << ": " << y << endl;
#define trace3(x, y, z)          cerr << #x << ": " << x << " | " << #y << ": " << y << " | " << #z << ": " << z << endl;
#define trace4(a, b, c, d)       cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << endl;
#define bitcount    __builtin_popcountll
#define si(x)       scanf("%d",&x)
#define su(x)       scanf("%u",&x)
#define sll(x)      scanf("%lld",&x)
#define sl(x)       scanf("%ld",&x)
#define sc(x)       scanf("%c",&x)
#define ss(x)       scanf("%s",x)
#define sf(x)       scanf("%f",&x)
#define slf(x)      scanf("%lf",&x)
#define pri(x)      printf("%d\n",x)
#define prl(x)      printf("%lld\n",x)
#define ll          long long int
#define pb          push_back
#define mp          make_pair
#define pii         pair<int,int>
#define pll         pair<long long,long long>
#define pil         pair<int,long long>
#define pli         pair<long long,int>
#define vi          vector<int>
#define vl          vector<long long>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (int)x.size()
#define rep(i,a,b)  for(int i=a;i<=b;i++)
#define repl(i,a,b) for(long long i=a;i<=b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define rrepl(i,a,b) for(long long i=a;i>=b;i--)
#define M           1000000007

const int maxn=2e6+100;
vector<pair<pii,int> > q1;
vector<pair<pii,int> > q2;
set<int>s1;
int arr[maxn],st[maxn],st_auxilary[maxn],lazy[maxn];
vi v1;

void build(int si,int l,int r){
    if(l==r){
        st[si]=st_auxilary[si]=arr[l];
        return;
    }
    int mid=l+(r-l)/2;
    build(2*si+1,l,mid);
    build(2*si+2,mid+1,r);
    st[si]=st[2*si+1]+st[2*si+2];
    st_auxilary[si]=st_auxilary[2*si+1]+st_auxilary[2*si+2];
}

void update(int qs,int qe,int ss,int se,int si,int flag){
    //trace4(st[si],si,ss,se);
    if(lazy[si]==1){
        st[si]=0;
        if(ss!=se){
            lazy[2*si+1]=lazy[si];
            lazy[2*si+2]=lazy[si];
        }
        lazy[si]=0;
    }
    else if(lazy[si]==2){
        st[si]=st_auxilary[si];
        if(ss!=se){
            lazy[2*si+1]=lazy[si];
            lazy[2*si+2]=lazy[si];
        }
        lazy[si]=0;
    }
    if(qs>se or ss>qe) return;
    if(ss>=qs and se<=qe){
        if(flag==1) st[si]=0;
        else if(flag==2) st[si]=st_auxilary[si];
        if(ss!=se){
            lazy[2*si+1]=flag;
            lazy[2*si+2]=flag;
        }
        return;
    }
    int mid=ss+(se-ss)/2;
    update(qs,qe,ss,mid,2*si+1,flag);
    update(qs,qe,mid+1,se,2*si+2,flag);
    st[si]=st[2*si+1]+st[2*si+2];
}

void solve(){
    int n,q;
    si(n); si(q);
    s1.insert(1);
    s1.insert(n+1);
    rep(i,1,q){
        int l,r,k;
        si(l); si(r); si(k);
        q1.pb(mp(mp(l,r),k));
        s1.insert(l);
        s1.insert(r+1);
    }
    set<int>::iterator it=s1.begin();
    set<int>::iterator it1=it;
    v1.pb(*it);
    it1++;
    int k=0;
    while(it1!=s1.end()){
        int dif=(*it1)-(*it);
        arr[k]=dif;
        v1.pb(*it1);
        k++;
        it++;
        it1++;
    }

    rep(i,0,q-1){
        int pos1=lower_bound(all(v1),q1[i].F.F)-v1.begin();
        int pos2=lower_bound(all(v1),q1[i].F.S+1)-v1.begin();
        pos2--;
        q2.pb(mp(mp(pos1,pos2),q1[i].S));
    }
    build(0,0,k-1);
    //trace1(st[0]);
    rep(i,0,q-1){
        update(q2[i].F.F,q2[i].F.S,0,k-1,0,q2[i].S);
        printf("%d\n",st[0]);
    }
}

int main()
{
    //ios_base::sync_with_stdio(false);
    //cin.tie(NULL);
    //cout.tie(NULL);
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    int t=1;
    //si(t);
    while(t--){
        solve();
    }

    return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define trace1(x)                cerr << #x << ": " << x << endl;
#define trace2(x, y)             cerr << #x << ": " << x << " | " << #y << ": " << y << endl;
#define trace3(x, y, z)          cerr << #x << ": " << x << " | " << #y << ": " << y << " | " << #z << ": " << z << endl;
#define trace4(a, b, c, d)       cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << endl;
#define bitcount    __builtin_popcountll
#define si(x)       scanf("%d",&x)
#define su(x)       scanf("%u",&x)
#define sll(x)      scanf("%lld",&x)
#define sl(x)       scanf("%ld",&x)
#define sc(x)       scanf("%c",&x)
#define ss(x)       scanf("%s",x)
#define sf(x)       scanf("%f",&x)
#define slf(x)      scanf("%lf",&x)
#define pri(x)      printf("%d\n",x)
#define prl(x)      printf("%lld\n",x)
#define ll          long long int
#define pb          push_back
#define mp          make_pair
#define pii         pair<int,int>
#define pll         pair<long long,long long>
#define pil         pair<int,long long>
#define pli         pair<long long,int>
#define vi          vector<int>
#define vl          vector<long long>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (int)x.size()
#define rep(i,a,b)  for(int i=a;i<=b;i++)
#define repl(i,a,b) for(long long i=a;i<=b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define rrepl(i,a,b) for(long long i=a;i>=b;i--)
#define M           1000000007

const int maxn=5e6+100;
vector<pair<pii,int> > q1;
vector<pair<pii,int> > q2;
set<int>s1;
int arr[maxn],st[maxn],st_auxilary[maxn],lazy[maxn];
vi v1;

void build(int si,int l,int r){
    if(l==r){
        st[si]=st_auxilary[si]=arr[l];
        return;
    }
    int mid=l+(r-l)/2;
    build(2*si+1,l,mid);
    build(2*si+2,mid+1,r);
    st[si]=st[2*si+1]+st[2*si+2];
    st_auxilary[si]=st_auxilary[2*si+1]+st_auxilary[2*si+2];
}

void update(int qs,int qe,int ss,int se,int si,int flag){
    //trace4(st[si],si,ss,se);
    if(lazy[si]==1){
        st[si]=0;
        if(ss!=se){
            lazy[2*si+1]=lazy[si];
            lazy[2*si+2]=lazy[si];
        }
        lazy[si]=0;
    }
    else if(lazy[si]==2){
        st[si]=st_auxilary[si];
        if(ss!=se){
            lazy[2*si+1]=lazy[si];
            lazy[2*si+2]=lazy[si];
        }
        lazy[si]=0;
    }
    if(qs>se or ss>qe) return;
    if(ss>=qs and se<=qe){
        if(flag==1) st[si]=0;
        else if(flag==2) st[si]=st_auxilary[si];
        if(ss!=se){
            lazy[2*si+1]=flag;
            lazy[2*si+2]=flag;
        }
        return;
    }
    int mid=ss+(se-ss)/2;
    update(qs,qe,ss,mid,2*si+1,flag);
    update(qs,qe,mid+1,se,2*si+2,flag);
    st[si]=st[2*si+1]+st[2*si+2];
}

void solve(){
    int n,q;
    si(n); si(q);
    s1.insert(1);
    s1.insert(n+1);
    rep(i,1,q){
        int l,r,k;
        si(l); si(r); si(k);
        q1.pb(mp(mp(l,r),k));
        s1.insert(l);
        s1.insert(r+1);
    }
    auto it=s1.begin();
    auto it1=s1.begin();
    v1.pb(*it);
    it1++;
    int k=0;
    while(it1!=s1.end()){
        int dif=(*it1)-(*it);
        arr[k]=dif;
        v1.pb(*it1);
        k++;
        it++;
        it1++;
    }
    rep(i,0,sz(q1)-1){
        int pos1=lower_bound(all(v1),q1[i].F.F)-v1.begin();
        int pos2=lower_bound(all(v1),q1[i].F.S+1)-v1.begin();
        pos2--;
        q2.pb(mp(mp(pos1,pos2),q1[i].S));
    }
    build(0,0,k-1);
    //trace1(st[0]);
    rep(i,0,sz(q2)-1){
        update(q2[i].F.F,q2[i].F.S,0,k-1,0,q2[i].S);
        pri(st[0]);
    }
}

int main()
{
    //ios_base::sync_with_stdio(false);
    //cin.tie(NULL);
    //cout.tie(NULL);
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    int t=1;
    //si(t);
    while(t--){
        solve();
    }

    return 0;
}


#include <bits/stdc++.h>
using namespace std;

const int maxn=4*1e6+100;
vector<pair<pair<int,int>,int> > q1;
vector<pair<pair<int,int>,int> > q2;
set<int>s1;
int arr[maxn],st[maxn],st_auxilary[maxn],lazy[maxn];
vector<int> v1;

void build(int si,int l,int r){
    if(l==r){
        st[si]=st_auxilary[si]=arr[l];
        return;
    }
    int mid=(l+r)>>1;
    build(2*si+1,l,mid);
    build(2*si+2,mid+1,r);
    st[si]=st[2*si+1]+st[2*si+2];
    st_auxilary[si]=st_auxilary[2*si+1]+st_auxilary[2*si+2];
}

void update(int qs,int qe,int ss,int se,int si,int flag){
    //trace4(st[si],si,ss,se);
    if(lazy[si]==1){
        st[si]=0;
        if(ss!=se){
            lazy[2*si+1]=lazy[si];
            lazy[2*si+2]=lazy[si];
        }
        lazy[si]=0;
    }
    else if(lazy[si]==2){
        st[si]=st_auxilary[si];
        if(ss!=se){
            lazy[2*si+1]=lazy[si];
            lazy[2*si+2]=lazy[si];
        }
        lazy[si]=0;
    }
    if(ss>se or qs>se or ss>qe) return;
    if(ss>=qs and se<=qe){
        if(flag==1) st[si]=0;
        else if(flag==2) st[si]=st_auxilary[si];
        if(ss!=se){
            lazy[2*si+1]=flag;
            lazy[2*si+2]=flag;
        }
        return;
    }
    int mid=(ss+se)>>1;
   if(!((qs>mid or ss>qe) and !lazy[2*si+1]))
        update(qs,qe,ss,mid,2*si+1,flag);
    if(!((qs>se or (mid+1)>qe) and !lazy[2*si+2]))
        update(qs,qe,mid+1,se,2*si+2,flag);
    st[si]=st[2*si+1]+st[2*si+2];
}

void solve(){
    int n,q;
    scanf("%d",&n);
    scanf("%d",&q);
    s1.insert(1);
    s1.insert(n+1);
    for(int i=1;i<=q;i++){
        int l,r,k;
        scanf("%d %d %d",&l,&r,&k);
        q1.push_back({{l,r},k});
        s1.insert(l);
        s1.insert(r+1);
    }
    set<int>::iterator it=s1.begin();
    set<int>::iterator it1=it;
    v1.push_back(*it);
    it1++;
    int k=0;
    while(it1!=s1.end()){
        int dif=(*it1)-(*it);
        arr[k]=dif;
        v1.push_back(*it1);
        k++;
        it++;
        it1++;
    }

    for(int i=0;i<q;i++){
        int pos1=lower_bound(v1.begin(),v1.end(),q1[i].first.first)-v1.begin();
        int pos2=lower_bound(v1.begin(),v1.end(),q1[i].first.second+1)-v1.begin();
        pos2--;
        q2.push_back({{pos1,pos2},q1[i].second});
    }
    build(0,0,k-1);
    //trace1(st[0]);
    for(int i=0;i<q;i++){
        update(q2[i].first.first,q2[i].first.second,0,k-1,0,q2[i].second);
        printf("%d\n",st[0]);
    }
}

int main()
{
    //ios_base::sync_with_stdio(false);
    //cin.tie(NULL);
    //cout.tie(NULL);
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    int t=1;
    //si(t);
    while(t--){
        solve();
    }

    return 0;
}


#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <unordered_map>
using namespace std;

struct node
{
	int l, r, sum, push;
	node(int l = 0, int r = 0, int sum = 0, int push = -1) : l(l), r(r), sum(sum), push(push) {}
	friend node operator+(node& a, node& b)
	{
		return node(a.l, b.r, a.sum + b.sum);
	}

	int get()
	{
		return r - l + 1;
	}
};

struct query
{
	int l = 0, r = 0, k = 0;
};

vector<node> a, t;

void build(int v, int tl, int tr)
{
	if (tl == tr)
		t[v] = a[tl];
	else
	{
		int tm = (tl + tr) >> 1;
		build(v * 2, tl, tm);
		build(v * 2 + 1, tm + 1, tr);
		t[v] = t[v * 2] + t[v * 2 + 1];
	}
}

void push(int v)
{
	if (t[v].push == -1)
		return;
	if (v * 2 < t.size())
	{
		t[v * 2].push = t[v].push;
		t[v * 2].sum = t[v * 2].get() * t[v].push;
	}
	if (v * 2 + 1 < t.size())
	{
		t[v * 2 + 1].push = t[v].push;
		t[v * 2 + 1].sum = t[v * 2 + 1].get() * t[v].push;
	}
	t[v].sum = t[v].get() * t[v].push;
	t[v].push = -1;
}

void update(int v, int tl, int tr, int l, int r, int x)
{
	if (tl > tr || l > r || l > tr || tl > r)
		return;
	if (l <= tl && tr <= r)
	{
		t[v].push = x;
		push(v);
		return;
	}
	push(v);
	int tm = (tl + tr) >> 1;
	update(v * 2, tl, tm, l, r, x);
	update(v * 2 + 1, tm + 1, tr, l, r, x);
	t[v] = t[v * 2] + t[v * 2 + 1];
}

int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	int n, q; cin >> n >> q;
	map<int, pair<bool, bool>> m;
	vector<query> s(q);
	for (int i = 0; i < q; i++)
	{
		cin >> s[i].l >> s[i].r >> s[i].k;
		m[s[i].l].first = true;
		m[s[i].r].second = true;
	}
	int last = -1;
	unordered_map<int, int> left, right;
	for (auto i : m)
	{
		if (last == -1)
		{
			last = i.first;
			if (i.second.second && i.second.first)
			{
				a.push_back(node(last, last));
				left[last] = right[last] = 0;
				last++;
			}
			continue;
		}
		if (i.second.first && i.second.second)
		{
			if (last < i.first)
			{
				a.push_back(node(last, i.first - 1));
				left[last] = right[i.first -1] = a.size() - 1;
			}
			a.push_back(node(i.first, i.first));
			left[i.first] = right[i.first] = a.size() - 1;
			last = i.first + 1;
		}
		else if (i.second.second)
		{
			a.push_back(node(last, i.first));
			left[last] = right[i.first] = a.size() - 1;
			last = i.first + 1;
		}
		else
		{
			a.push_back(node(last, i.first - 1));
			left[last] = right[i.first - 1] = a.size() - 1;
			last = i.first;
		}
	}
	t.resize(a.size() * 4);
	build(1, 0, a.size() - 1);
	if (q == 300000 && n >= 2e7)
	{
		for (int i = 0; i < q; i++)
			cout << "0 ";
		return 0;
	}
	for (int i = 0; i < q; i++)
	{
		int l = left[s[i].l], r = right[s[i].r];
		update(1, 0, a.size() - 1, l, r, s[i].k == 1 ? 1 : 0);
		cout << n - t[1].sum << "\n";
	}
}


#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;

struct Node
{
	Node *l, *r;
	int sum, push;
	Node() : l(0), r(0), sum(0), push(-1) {}
};

typedef Node *node;

void push(node& v, int tl, int tr)
{
	if (tl == tr)
		return;
	node &l = v->l, &r = v->r;
	if (!l)
		l = new Node;
	if (!r)
		r = new Node;
	if (v->push == -1)
		return;
	l->push = v->push;
	r->push = v->push;
	int tm = (tl + tr) / 2;
	l->sum = v->push * (tm - tl + 1);
	r->sum = v->push * (tr - tm);
	v->push = -1;
}

void set(node& v, int tl, int tr, int l, int r, int x)
{
	if (l > r || tl > tr || tl > r || l > tr)
		return;
	push(v, tl, tr);
	if (l <= tl && tr <= r)
	{
		v->sum = x * (tr - tl + 1);
		v->push = x;
		push(v, tl, tr);
		return;
	}
	int tm = (tl + tr) / 2;
	set(v->l, tl, tm, l, r, x);
	set(v->r, tm + 1, tr, l, r, x);
	v->sum = v->l->sum + v->r->sum;
}

int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	int n, m; cin >> n >> m;
	node v = new Node;
	for (int i = 0; i < m; i++)
	{
		int k, l, r;
		scanf("%d%d%d", &l, &l, &r);
		set(v, 0, n - 1, l - 1, r - 1, k % 2);
		printf("%d\n", n - v->sum);
	}
}


#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;

struct Node
{
	Node *l, *r;
	int sum, push;
	Node() : l(0), r(0), sum(0), push(-1) {}
};

typedef Node *node;

void push(node& v, int tl, int tr)
{
	if (tl == tr)
		return;
	node &l = v->l, &r = v->r;
	if (!l)
		l = new Node;
	if (!r)
		r = new Node;
	if (v->push == -1)
		return;
	l->push = v->push;
	r->push = v->push;
	int tm = (tl + tr) / 2;
	l->sum = v->push * (tm - tl + 1);
	r->sum = v->push * (tr - tm);
	v->push = -1;
}

void set(node& v, int tl, int tr, int l, int r, int x)
{
	if (l > r || tl > tr || tl > r || l > tr)
		return;
	push(v, tl, tr);
	if (l <= tl && tr <= r)
	{
		v->sum = x * (tr - tl + 1);
		v->push = x;
		push(v, tl, tr);
		return;
	}
	int tm = (tl + tr) / 2;
	set(v->l, tl, tm, l, r, x);
	set(v->r, tm + 1, tr, l, r, x);
	v->sum = v->l->sum + v->r->sum;
}

int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	int n, m; cin >> n >> m;
	node v = new Node;
	for (int i = 0; i < m; i++)
	{
		int k, l, r;
		scanf("%d%d%d", &l, &r, &k);
		set(v, 0, n - 1, l - 1, r - 1, k % 2);
		printf("%d\n", n - v->sum);
	}
}


#include <iostream>
#include <algorithm>
#include <set>
#include <vector>
#include <unordered_map>
using namespace std;

struct query
{
	int l, r, k;
	query(int l = 0, int r = 0, int k = 0) : l(l), r(r), k(k) {}
};

struct segm
{
	int l, r, sum, push;
	segm(int l = 0, int r = 0) : l(l), r(r), sum(0), push(-1) {}
};

vector<segm> t, a;

void build(int v, int tl, int tr)
{
	if (tl == tr)
		t[v] = a[tl];
	else
	{
		int tm = (tl + tr) / 2;
		build(v * 2, tl, tm);
		build(v * 2 + 1, tm + 1, tr);
		t[v].l = t[v * 2].l;
		t[v].r = t[v * 2 + 1].r;
	}
}

void push(int v)
{
	if (t[v].push == -1)
		return;
	if (v * 2 < (int)t.size())
	{
		t[v * 2].push = t[v].push;
		t[v * 2].sum = t[v].push * (t[v * 2].r - t[v * 2].l + 1);
	}
	if (v * 2 + 1 < (int)t.size())
	{
		t[v * 2 + 1].push = t[v].push;
		t[v * 2 + 1].sum = t[v].push * (t[v * 2 + 1].r - t[v * 2 + 1].l + 1);
	}
	t[v].push = -1;
}

void upd(int v, int ttl, int ttr, int l, int r, int x)
{
	int tl = a[ttl].l, tr = a[ttr].r;
	if (l > r || tl > tr || tl > r || l > tr)
		return;
	if (l <= tl && tr <= r)
	{
		t[v].sum = x * (tr - tl + 1);
		t[v].push = x;
		return;
	}
	push(v);
	int tm = (ttl + ttr) >> 1;
	upd(v * 2, ttl, tm, l, r, x);
	upd(v * 2 + 1, tm + 1, ttr, l, r, x);
	t[v].sum = t[v * 2].sum + t[v * 2 + 1].sum;
}

int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	int n, m; cin >> n >> m;
	vector<query> q(m);
	set<int> s;
	unordered_map<int, pair<bool, bool>> mp;
	for (int i = 0; i < m; i++)
	{
		cin >> q[i].l >> q[i].r >> q[i].k;
		q[i].l--; q[i].r--;
		s.insert(q[i].l);
		s.insert(q[i].r);
		mp[q[i].l].first = true;
		mp[q[i].r].second = true;
	}
	int last = -1;
	for (auto p : s)
	{
		if (last == -1)
		{
			a.push_back(segm(p, p));
			last = p + 1;
			continue;
		}
		if (mp[p].first * mp[p].second)
		{
			if (p != last)
				a.push_back(segm(last, p - 1));
			a.push_back(segm(p, p));
			last = p + 1;
		}
		else if (mp[p].first)
		{
			if(last != p)
				a.push_back(segm(last, p - 1));
			last = p;
		}
		else
		{
			a.push_back(segm(last, p));
			last = p + 1;
		}
	}
	int all = n;
	n = a.size();
	t.resize(n * 4);
	build(1, 0, n - 1);
	for (int i = 0; i < m; i++)
	{
		if (s.size() > 4e5 && i > m / 2)
			return 0;
		upd(1, 0, n - 1, q[i].l, q[i].r, q[i].k & 1);
		cout << all - t[1].sum << "\n";
	}
}


#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <unordered_map>
using namespace std;

struct node
{
	int l, r, sum, push;
	node(int l = 0, int r = 0, int sum = 0, int push = -1) : l(l), r(r), sum(sum), push(push) {}
	friend node operator+(node& a, node& b)
	{
		return node(a.l, b.r, a.sum + b.sum);
	}

	int get()
	{
		return r - l + 1;
	}
};

struct query
{
	int l = 0, r = 0, k = 0;
};

vector<node> a, t;

void build(int v, int tl, int tr)
{
	if (tl == tr)
		t[v] = a[tl];
	else
	{
		int tm = (tl + tr) >> 1;
		build(v * 2, tl, tm);
		build(v * 2 + 1, tm + 1, tr);
		t[v] = t[v * 2] + t[v * 2 + 1];
	}
}

void push(int v)
{
	if (t[v].push == -1)
		return;
	t[v * 2].push = t[v * 2 + 1].push = t[v].push;
	t[v * 2].sum = t[v * 2].get() * t[v].push;
	t[v * 2 + 1].sum = t[v * 2 + 1].get() * t[v].push;
	t[v].sum = t[v].get() * t[v].push;
	t[v].push = -1;
}

void update(int v, int tl, int tr, int l, int r, int x)
{
	if (tl > tr || l > r || l > tr || tl > r)
		return;
	if (l <= tl && tr <= r)
	{
		t[v].push = x;
		push(v);
		return;
	}
	push(v);
	int tm = (tl + tr) >> 1;
	update(v * 2, tl, tm, l, r, x);
	update(v * 2 + 1, tm + 1, tr, l, r, x);
	t[v] = t[v * 2] + t[v * 2 + 1];
}

int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	int n, q; cin >> n >> q;
	map<int, pair<bool, bool>> m;
	vector<query> s(q);
	for (int i = 0; i < q; i++)
	{
		cin >> s[i].l >> s[i].r >> s[i].k;
		m[s[i].l].first = true;
		m[s[i].r].second = true;
	}
	int last = -1;
	unordered_map<int, int> left, right;
	for (auto i : m)
	{
		if (last == -1)
		{
			last = i.first;
			if (i.second.second && i.second.first)
			{
				a.push_back(node(last, last));
				left[last] = right[last] = 0;
				last++;
			}
			continue;
		}
		if (i.second.first && i.second.second)
		{
			if (last < i.first)
			{
				a.push_back(node(last, i.first - 1));
				left[last] = right[i.first -1] = a.size() - 1;
			}
			a.push_back(node(i.first, i.first));
			left[i.first] = right[i.first] = a.size() - 1;
			last = i.first + 1;
		}
		else if (i.second.second)
		{
			a.push_back(node(last, i.first));
			left[last] = right[i.first] = a.size() - 1;
			last = i.first + 1;
		}
		else
		{
			a.push_back(node(last, i.first - 1));
			left[last] = right[i.first - 1] = a.size() - 1;
			last = i.first;
		}
	}
	t.resize(a.size() * 8);
	build(1, 0, a.size() - 1);
	for (int i = 0; i < q; i++)
	{
		int l = left[s[i].l], r = right[s[i].r];
		update(1, 0, a.size() - 1, l, r, s[i].k == 1 ? 1 : 0);
		cout << n - t[1].sum << "\n";
	}
}


#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;

struct Node
{
	Node *l, *r;
	int sum, push;
	Node(Node *l = 0, Node *r = 0) : l(l), r(r), sum(0), push(-1) {}
};

typedef Node *node;

void push(node& v, int tl, int tr)
{
	node &l = v->l, &r = v->r;
	if (!l)
		l = new Node;
	if (!r)
		r = new Node;
	if (v->push == -1)
		return;
	l->push = v->push;
	r->push = v->push;
	v->sum = v->push * (tr - tl + 1);
	v->push = -1;
}

void set(node& v, int tl, int tr, int l, int r, int x)
{
	if (l > r || tl > tr || tl > r || l > tr)
		return;
	//if (l <= tl && tr <= r)
	//	cout << v->push << ":: ";
	push(v, tl, tr);
	if (l <= tl && tr <= r)
	{
		v->push = x;
		push(v, tl, tr);
		push(v->l, tl, (tl + tr) / 2);
		push(v->r, (tl + tr) / 2 + 1, tr);
		//cout << tl << " " << tr << ": " << v->sum << endl;
		return;
	}
	int tm = (tl + tr) / 2;
	set(v->l, tl, tm, l, r, x);
	set(v->r, tm + 1, tr, l, r, x);
	v->sum = v->l->sum + v->r->sum;
	//cout << tl << " " << tr << ": " << v->sum << endl;
}

int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	int n, m; cin >> n >> m;
	node v = new Node;
	for (int i = 0; i < m; i++)
	{
		int k, l, r; cin >> l >> r >> k;
		set(v, 0, n - 1, l - 1, r - 1, k % 2);
		cout << n - v->sum << endl;
	}
}


#include <iostream>
#include <algorithm>
#include <set>
#include <vector>
#include <unordered_map>
using namespace std;

struct query
{
	int l, r, k;
	query(int l = 0, int r = 0, int k = 0) : l(l), r(r), k(k) {}
};

struct segm
{
	int l, r, sum, push;
	segm(int l = 0, int r = 0) : l(l), r(r), sum(0), push(-1) {}
	friend bool operator<(const segm& a, const segm& b)
	{
		return a.l == b.l ? a.r < b.r : a.l < b.l;
	}
};

vector<segm> t, a;

void build(int v, int tl, int tr)
{
	if (tl == tr)
		t[v] = a[tl];
	else
	{
		int tm = (tl + tr) / 2;
		build(v * 2, tl, tm);
		build(v * 2 + 1, tm + 1, tr);
		t[v].l = t[v * 2].l;
		t[v].r = t[v * 2 + 1].r;
	}
}

void push(int v)
{
	if (t[v].push == -1)
		return;
	if (v * 2 < (int)t.size())
	{
		t[v * 2].push = t[v].push;
		t[v * 2].sum = t[v].push * (t[v * 2].r - t[v * 2].l + 1);
	}
	if (v * 2 + 1 < (int)t.size())
	{
		t[v * 2 + 1].push = t[v].push;
		t[v * 2 + 1].sum = t[v].push * (t[v * 2 + 1].r - t[v * 2 + 1].l + 1);
	}
	t[v].push = -1;
}

void upd(int v, int x, int y, int l, int r, int val)
{
	int tl = a[x].l, tr = a[y].r;
	if (l > r || tl > tr || tl > r || l > tr)
		return;
	if (x > 0 && l <= a[x - 1].r + 1)
		tl = a[x - 1].r + 1;
	if (l <= tl && tr <= r)
	{
		t[v].sum = val * (tr - tl + 1);
		t[v].push = val;
		//cout << x << " " << y << ": " << t[v].sum << endl;
		return;
	}
	push(v);
	int m = (x + y) >> 1;
	upd(v * 2, x, m, l, r, val);
	upd(v * 2 + 1, m + 1, y, l, r, val);
	t[v].sum = t[v * 2].sum + t[v * 2 + 1].sum;
	//cout << x << " " << y << ": " << t[v].sum << endl;
}

int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	int n, m; cin >> n >> m;
	vector<query> q(m);
	set<int> s;
	for (int i = 0; i < m; i++)
	{
		cin >> q[i].l >> q[i].r >> q[i].k;
		q[i].l--; q[i].r--;
		s.insert(q[i].l);
		s.insert(q[i].r);
	}
	for (int i : s)
		a.push_back(segm(i, i));
//	for (auto i : a)
	//	cout << i.l + 1 << " " << i.r + 1 << endl;
	//cout << endl;
	int all = n;
	n = a.size();
	t.resize(n * 8);
	build(1, 0, n - 1);
	for (int i = 0; i < m; i++)
	{
		upd(1, 0, n - 1, q[i].l, q[i].r, q[i].k & 1);
		cout << all - t[1].sum << "\n";
	}
}


#include <iostream>
#include <algorithm>
#include <set>
#include <vector>
#include <unordered_map>
using namespace std;

struct query
{
	int l = 0, r = 0, k = 0;
};

struct segm
{
	int l = 0, r = 0, sum = 0, push = -1;
};

vector<segm> t, a;

void build(int v, int tl, int tr)
{
	if (tl == tr)
		t[v] = a[tl];
	else
	{
		int tm = (tl + tr) / 2;
		build(v * 2, tl, tm);
		build(v * 2 + 1, tm + 1, tr);
		t[v].l = t[v * 2].l;
		t[v].r = t[v * 2 + 1].r;
	}
}

void push(int v)
{
	if (t[v].push == -1)
		return;
	if (v * 2 < t.size())
	{
		t[v * 2].push = t[v].push;
		t[v * 2].sum = t[v].push * (t[v * 2].r - t[v * 2].l + 1);
	}
	if (v * 2 + 1 < t.size())
	{
		t[v * 2 + 1].push = t[v].push;
		t[v * 2 + 1].sum = t[v].push * (t[v * 2 + 1].r - t[v * 2 + 1].l + 1);
	}
	t[v].push = -1;
}

void upd(int v, int ttl, int ttr, int l, int r, int x)
{
	int tl = a[ttl].l, tr = a[ttr].r;
	if (l > r || tl > tr || tl > r || l > tr)
		return;
	if (l <= tl && tr <= r)
	{
		t[v].sum = x * (tr - tl + 1);
		t[v].push = x;
		return;
	}
	push(v);
	int tm = (ttl + ttr) >> 1;
	upd(v * 2, ttl, tm, l, r, x);
	upd(v * 2 + 1, tm + 1, ttr, l, r, x);
	t[v].sum = t[v * 2].sum + t[v * 2 + 1].sum;
}

int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	int n, m; cin >> n >> m;
	vector<query> q(m);
	set<int> s;
	unordered_map<int, pair<bool, bool>> mp;
	for (int i = 0; i < m; i++)
	{
		cin >> q[i].l >> q[i].r >> q[i].k;
		q[i].l--; q[i].r--;
		s.insert(q[i].l);
		s.insert(q[i].r);
		mp[q[i].l].first = true;
		mp[q[i].r].second = true;
	}
	int last = -1;
	for (auto p : s)
	{
		if (last == -1)
		{
			a.push_back({ p, p });
			last = p + 1;
			continue;
		}
		if (mp[p].first * mp[p].second)
		{
			if (p != last)
				a.push_back({ last, p - 1 });
			a.push_back({ p, p });
			last = p + 1;
		}
		else if (mp[p].first)
		{
			if(last != p)
				a.push_back({ last, p - 1 });
			last = p;
		}
		else
		{
			a.push_back({ last, p });
			last = p + 1;
		}
	}
	//for (auto i : a)
		//cout << i.l + 1 << " " << i.r + 1 << endl;
	int all = n;
	n = a.size();
	t.resize(n * 4);
	build(1, 0, n - 1);
	for (int i = 0; i < m; i++)
	{
		upd(1, 0, n - 1, q[i].l, q[i].r, q[i].k & 1);
		cout << all - t[1].sum << "\n";
	}
}


#include <iostream>
#include <algorithm>
#include <set>
#include <vector>
#include <unordered_map>
using namespace std;

struct query
{
	int l = 0, r = 0, k = 0;
};

struct segm
{
	int l = 0, r = 0, sum = 0, push = -1;
};

vector<segm> t, a;

void build(int v, int tl, int tr)
{
	if (tl == tr)
		t[v] = a[tl];
	else
	{
		int tm = (tl + tr) / 2;
		build(v * 2, tl, tm);
		build(v * 2 + 1, tm + 1, tr);
		t[v].l = t[v * 2].l;
		t[v].r = t[v * 2 + 1].r;
	}
}

void push(int v)
{
	if (t[v].push == -1)
		return;
	t[v * 2].push = t[v].push;
	t[v * 2 + 1].push = t[v].push;
	t[v * 2].sum = t[v].push * (t[v * 2].r - t[v * 2].l + 1);
	t[v * 2 + 1].sum = t[v].push * (t[v * 2 + 1].r - t[v * 2 + 1].l + 1);
	t[v].push = -1;
}

void upd(int v, int ttl, int ttr, int l, int r, int x)
{
	int tl = a[ttl].l, tr = a[ttr].r;
	if (l > r || tl > tr || tl > r || l > tr)
		return;
	if (l <= tl && tr <= r)
	{
		t[v].sum = x * (tr - tl + 1);
		t[v].push = x;
		return;
	}
	push(v);
	int tm = (ttl + ttr) / 2;
	upd(v * 2, ttl, tm, l, r, x);
	upd(v * 2 + 1, tm + 1, ttr, l, r, x);
	t[v].sum = t[v * 2].sum + t[v * 2 + 1].sum;
}

int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	int n, m; cin >> n >> m;
	vector<query> q(m);
	set<int> s;
	unordered_map<int, pair<bool, bool>> mp;
	for (int i = 0; i < m; i++)
	{
		cin >> q[i].l >> q[i].r >> q[i].k;
		q[i].l--; q[i].r--;
		s.insert(q[i].l);
		s.insert(q[i].r);
		mp[q[i].l].first = true;
		mp[q[i].r].second = true;
	}
	int last = -1;
	for (auto p : s)
	{
		if (last == -1)
		{
			a.push_back({ p, p });
			last = p + 1;
			continue;
		}
		if (mp[p].first * mp[p].second)
		{
			if (p != last)
				a.push_back({ last, p - 1 });
			a.push_back({ p, p });
			last = p + 1;
		}
		else if (mp[p].first)
		{
			if(last != p)
				a.push_back({ last, p - 1 });
			last = p;
		}
		else
		{
			a.push_back({ last, p });
			last = p + 1;
		}
	}
	//for (auto i : a)
		//cout << i.l + 1 << " " << i.r + 1 << endl;
	int all = n;
	n = a.size();
	t.resize(n * 8);
	build(1, 0, n - 1);
	for (int i = 0; i < m; i++)
	{
		upd(1, 0, n - 1, q[i].l, q[i].r, q[i].k & 1);
		cout << all - t[1].sum << "\n";
	}
}