#include #include #include #include using namespace std; using mint=atcoder::modint998244353; bool op(bool a,bool b){return a;} bool e(){return false;} bool mp(int f,bool x) { if(f==0); else if(f==1)x=!x; else if(f==2)x=false; else x=true; return x; } int cmp(int f,int g) { static const int tb[4][4]={ {0,1,2,3}, {1,0,3,2}, {2,2,2,2}, {3,3,3,3}, }; return tb[f][g]; } int id(){return 0;} int N,Q; int M[1<<17]; int F[1<<17],T[1<<17]; mint dp[1<<17][31]; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); cin>>N>>Q; for(int i=0;i>M[i]; vectorinitF(N,false),initT(N,true); atcoder::lazy_segtreesegF[30],segT[30]; for(int k=0;k<30;k++) { segF[k]=atcoder::lazy_segtree(initF); segT[k]=atcoder::lazy_segtree(initT); } for(int i=0;i>C>>L>>R>>X; L--; if(C=='o') { for(int k=0;k<30;k++)if(X>>k&1) { segF[k].apply(L,R,3); segT[k].apply(L,R,3); } } else { for(int k=0;k<30;k++)if(X>>k&1) { segF[k].apply(L,R,1); segT[k].apply(L,R,1); } } } for(int k=0;k<30;k++) { for(int i=0;i>k&1; for(int b=0;b<=up;b++) { int p=(b?T[i]:F[i])>>k&1; for(int l=0;l<30;l++) { way[nxt][j|b