#include<bits/stdc++.h>
#define N 600050
const int mod=998244353,inv2=mod+1>>1;
using namespace std;
int n,al,a[N],b[N],bin[30];
inline int qpow(int d,int z){
	int ret=1;
	for(;z;z>>=1,d=1ll*d*d%mod)
		if(z&1)ret=1ll*ret*d%mod;
	return ret;
}
inline void fwt(int *a,int n,int tag){
	for(int i=1;i<n;i<<=1){
		for(int j=0,I=i<<1;j<n;j+=I){
			for(int k=0;k<i;++k){
				int x=a[j+k],y=a[j+k+i];
				a[j+k]=(x+y)%mod;
				a[j+k+i]=(x+mod-y)%mod;
				if(tag==-1)a[j+k]=1ll*inv2*a[j+k]%mod,a[j+k+i]=1ll*inv2*a[j+k+i]%mod;
			}
		}
	}
}
int main(){
	for(int i=0;i<=25;++i)bin[i]=1<<i;
	scanf("%d",&n);
	for(int i=0;i<bin[n];++i)scanf("%d",&a[i]),al+=a[i];
	al=qpow(al,mod-2);
	for(int i=0;i<bin[n];++i)a[i]=1ll*al*a[i]%mod;a[0]=(a[0]+mod-1)%mod;
	for(int i=1;i<bin[n];++i)b[i]=mod-1;b[0]=bin[n]-1;
	fwt(a,bin[n],1);fwt(b,bin[n],1);
	for(int i=0;i<bin[n];++i)a[i]=1ll*qpow(a[i],mod-2)*b[i]%mod;
	fwt(a,bin[n],-1);a[0]=mod-a[0];
	puts("0");
	for(int i=1;i<bin[n];++i)printf("%d\n",(a[i]+a[0])%mod);
	return 0;
}