#include <bits/stdc++.h>
#define rep(i,n) for ((i)=1;(i)<=(n);(i)++)
using namespace std;
const int mod=998244353;
int n,m,i,j,a[262145],b[262145],sum;
int pw(int x,int y){
	int z=1;
	while(y){
		if(y&1){
			z=1ll*z*x%mod;
		}
		x=1ll*x*x%mod;
		y/=2;
	}
	return z;
}
void fwt(int *a,int op){
	int i,j;
	for(i=0;i<n;i++){
		for(j=0;j<m;j++)if(!((j>>i)&1)){
			int x=a[j],y=a[j|(1<<i)];
			a[j]=(x+y)%mod;
			a[j|(1<<i)]=(x-y+mod)%mod;
			if(op==-1){
				a[j]=1ll*a[j]*(mod+1)/2%mod;
				a[j|(1<<i)]=1ll*a[j|(1<<i)]*(mod+1)/2%mod;
			}
		}
	} 
}
int main(){
	cin>>n;m=(1<<n);
	for(i=0;i<m;i++){
		cin>>a[i];
		sum+=a[i];
	}
	sum=pw(sum,mod-2);
	for(i=0;i<m;i++){
		a[i]=1ll*a[i]*sum%mod;
		b[i]=mod-1;
	}
	b[0]=m-1;
	a[0]=(a[0]-1+mod)%mod;
	fwt(a,1);fwt(b,1);
	for(i=0;i<m;i++){
		a[i]=1ll*b[i]*pw(a[i],mod-2)%mod;
	}
	fwt(a,-1);
	for(i=0;i<m;i++){
		cout<<(a[i]-a[0]+mod)%mod<<endl;
	}
	return 0;
}