#include using namespace std; #include #define elif else if using mint=atcoder::modint998244353; using S=pair; mint pow11[1<<18]; mint pow2[1<<18]; S node[10][1<<18]; S calc(S L,S R){ return {L.first*pow11[R.second]+R.first*pow2[L.second],L.second+R.second}; } void merge(int i,int j){ int L=j; int R=L^(1<<(i-1)); node[i][L]=calc(node[i-1][L],node[i-1][R]); } int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); int n; cin>>n; int N=1<>s; for(int i=0;i>q; for(int tc=0;tc>t; if(t==1){ cin>>x>>y; node[0][x]={y,1}; for(int i=0;i>(i+1))<<(i+1); r=l+(1<<(i+1)); for(int j=l;j>L>>R>>X; R++; S ans={0,0}; for(int i=0;i>i)&1)&&(L+(1<=0;--i){ if(L+(1<