#include #define MOD 998244353 using namespace std; typedef long long ll; ll pow_mod(ll x,int k) { ll ans=1; while (k) { if (k&1) ans=ans*x%MOD; x=x*x%MOD; k>>=1; } return ans; } inline void update(ll &x,ll y) { x=(x+y)%MOD; } vector e[100005]; bool vis[100005],vis2[100005],cir[100005]; void dfs(int x) { vis2[x]=1; for(int i=0;i=0;i--) { for(int j=1;j<=n;j++) { num[j]=((!i)?1LL:((b[j]&((1LL<>i)&1); } ll v=((!i)?1LL:((m&((1LL<>i)&1); f[0][0]=1; for(int j=1;j<=n;j++) { f[j][0]=f[j][1]=0; for(int t1=0;t1<2;t1++) if (f[j-1][t1]) { for(int t2=0;t2<=val[j];t2++) update(f[j][t1^t2],f[j-1][t1]*((t2t) break; if (vs