#include<set>    
#include<map>    
#include<stack>    
#include<ctime>    
#include<cstdio>    
#include<queue>    
#include<cmath>    
#include<vector>    
#include<cstring>   
#include<climits>    
#include<iostream>   
#include<algorithm>
using namespace std;
#define LL long long
LL read(){
    LL f=1,x=0;char c=getchar();
    while(c<'0'||'9'<c){if(c==EOF)exit(0);if(c=='-')f=-1;c=getchar();}
    while('0'<=c&&c<='9'){x=x*10+c-'0';c=getchar();}
    return f*x;
}
#define MAXN 1000000
#define INF 0x3f3f3f3f
#define  Mod 998244353
#define inv2 499122177
//LL Mul(LL x,LL y){return (x*y-(LL)((long double)x*y/Mod)*Mod+Mod)%Mod;}
LL Pow(LL x,LL y){
	LL ret=1;
	while(y){
		if(y&1) ret=ret*x%Mod;
		x=x*x%Mod,y>>=1;
	}
	return ret;
}
int Len(int n){int len=1;while(len<=n)len<<=1;return len;}
void FWT_or(LL *A,int n,int opt){
	for(int i=1;i<n;i<<=1)
		for(int j=0,s=i<<1;j<n;j+=s)
			for(int k=0;k<i;k++)
				A[i+j+k]=(A[i+j+k]+(Mod+1ll*opt*A[j+k])%Mod)%Mod;
	return ;
}
void FWT_and(LL *A,int n,int opt){
	for(int i=1;i<n;i<<=1)
		for(int j=0,s=i<<1;j<n;j+=s)
			for(int k=0;k<i;k++)
				A[j+k]=(A[j+k]+(Mod+1ll*opt*A[i+j+k])%Mod)%Mod;
	return ;
}
void FWT_xor(LL *A,int n,int opt){
	for(int i=1;i<n;i<<=1)
		for(int j=0,s=i<<1;j<n;j+=s)
			for(int k=0;k<i;k++){
				LL x=A[j+k],y=A[i+j+k];
				A[j+k]=(x+y)%Mod,A[i+j+k]=(x-y+Mod)%Mod;
				if(opt==-1) A[j+k]=1ll*A[j+k]*inv2%Mod,A[i+j+k]=1ll*A[i+j+k]*inv2%Mod;
			}
	return ;
}
LL p[MAXN+5],h[MAXN+5],f[MAXN+5];
int main(){
	LL sum=0;
	int n=read();
	for(int i=0;i<(1<<n);i++)
		p[i]=read(),sum=(sum+p[i])%Mod;
	sum=Pow(sum,Mod-2);
	for(int i=0;i<(1<<n);i++)
		p[i]=p[i]*sum%Mod;
	p[0]=(p[0]+Mod-1)%Mod;
	h[0]=(1<<n)-1;
	for(int i=1;i<(1<<n);i++)
		h[i]=Mod-1;
	FWT_xor(h,(1<<n),1),FWT_xor(p,(1<<n),1);
	for(int i=0;i<(1<<n);i++)
		f[i]=h[i]*Pow(p[i],Mod-2)%Mod;
	FWT_xor(f,(1<<n),-1);
	for(int i=0;i<(1<<n);i++)
		printf("%lld\n",((f[i]-f[0])%Mod+Mod)%Mod);
	return 0;
}