#include<bits/stdc++.h>

using namespace std;

typedef long long LL;
#define N (1<<19)

const LL mod=998244353;
LL n,sum,isum,a[N],ans;

void upd(LL &x,LL y){x=(x+y)%mod;}

LL inv(LL x){
	return x==1?1:(mod-mod/x)*inv(mod%x)%mod;
}

void fwt(LL f[],LL n){
	for (LL i=0;i<n;++i){
		LL t=1<<i;
		for (LL j=0;j<1<<n;j+=t<<1){
			LL *f1=f+j,*f2=f+j+t;
			for (LL k=0;k<t;++k){
				LL x=(f1[k]+f2[k])%mod,y=(f1[k]-f2[k]+mod)%mod;
				f1[k]=x; f2[k]=y;
			}
		}
	}
}

int main(){
	scanf("%lld",&n);
	for (LL i=0;i<1<<n;++i){
		scanf("%lld",a+i);
		upd(sum,a[i]);
	}
	isum=inv(sum);
	for (LL i=0;i<1<<n;++i) a[i]=a[i]*isum%mod;
	fwt(a,n);
	a[0]=0; for (LL i=1;i<1<<n;++i) a[i]=inv((1-a[i]+mod)%mod);
	fwt(a,n);
	for (LL i=0;i<1<<n;++i){
		ans=(a[0]-a[i]+mod)%mod;
		printf("%lld\n",ans);
	}
	
	return 0;
}
			