#include using namespace std; #include #include //#define int long long #define REP(i,m,n) for(int i=(m);i<(n);i++) #define rep(i,n) REP(i,0,n) #define pb push_back #define all(a) a.begin(),a.end() #define rall(c) (c).rbegin(),(c).rend() #define mp make_pair #define endl '\n' //#define vec vector //#define mat vector > #define fi first #define se second #define double long double typedef long long ll; typedef unsigned long long ull; typedef pair pll; //typedef long double ld; typedef complex Complex; const ll INF=1e9+7; const ll MOD=998244353; const ll inf=INF*INF; const ll mod=MOD; const ll MAX=200010; const double PI=acos(-1.0); typedef vector > mat; typedef vector vec; ll dx[]={0,1,0,-1}; ll dy[]={1,0,-1,0}; ll rui(ll a,ll b){ ll res=1; ll x=a; while(b){ if(b&1)res=res*x%mod; x=x*x%mod; b/=2; } return res; } void solve(){ ll N,M;cin>>N>>M; if(N==0){ cout<<0<a(0); while(cop){ cnt++; a.pb(cop%2); cop/=2; } if(cnt>=M){ vectorb(2*cnt+1); rep(i,M){ rep(j,cnt)b[j+i]^=a[j]; } ll ans=0; rep(j,2*cnt+1){ ans+=rui(2,j)*b[j]%mod; ans%=mod; } cout<b=a; REP(i,1,cnt)a[i]^=a[i-1]; for(int i=cnt-2;i>=0;i--)b[i]^=b[i+1]; ll ans=0; for(int i=cnt-2;i>=0;i--){ ans+=(rui(2,i)*a[i]+rui(2,M-1+(cnt-i-1))*b[(cnt-i-1)])%mod; ans%=mod; } ans+=(rui(2,M)-rui(2,cnt-1))%mod*a[cnt-1]; ans%=mod; if(ans<0)ans+=mod; cout<