#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
#define mp make_pair
#define PI pair<int,int>
#define For(i,l,r) for(int i=(int)(l);i<=(int)(r);i++)
#define Rep(i,r,l) for(int i=(int)(r);i>=(int)(l);i--)
#define pb push_back
#define fi first
#define se second
inline char gc(){
    static char buf[100000],*p1=buf,*p2=buf;
    return p1==p2&&(p2=(p1=buf)+fread(buf,1,100000,stdin),p1==p2)?EOF:*p1++;
}
#define gc getchar
inline ll read(){
	ll x = 0; char ch = gc(); bool positive = 1;
	for (; !isdigit(ch); ch = gc())	if (ch == '-')	positive = 0;
	for (; isdigit(ch); ch = gc())	x = x * 10 + ch - '0';
	return positive ? x : -x;
}
inline void write(ll a){
    if(a<0){
    	a=-a; putchar('-');
	}
    if(a>=10)write(a/10);
    putchar('0'+a%10);
}
inline void writeln(ll a){write(a); puts("");}
inline void wri(ll a){write(a); putchar(' ');}
inline ull rnd(){
	return ((ull)rand()<<30^rand())<<4|rand()%4;
}
const int N=1<<18|2,mod=998244353;
ll a[N],f[N],fd[N],A[N];
ll ksm(ll a,int b){
	int ans=1;
	for(;b;b>>=1){
		if(b&1)ans=ans*a%mod;
		a=a*a%mod;
	}
	return ans;
}
void FWT(ll *a,int n){
	For(i,0,n-1){
		For(j,0,(1<<n)-1)if(j>>i&1){
			ll x=a[j-(1<<i)],y=a[j]; //cout<<j<<" "<<a[j]<<" "<<x<<" "<<y<<endl;
			a[j-(1<<i)]=(x+y)%mod; a[j]=(x-y)%mod;
		}
	}
}
void UFWT(ll *a,int n){
	FWT(a,n);
	ll inv=ksm(1<<n,mod-2);
	//For(i,0,(1<<n)-1)a[i]=a[i]*inv%mod;
}
int main(){
	int n=read(); ll sum=0;
	For(i,0,(1<<n)-1)a[i]=read();
	For(i,0,(1<<n)-1)sum=(sum+a[i])%mod;
	sum=ksm(sum,mod-2); 
	For(i,0,(1<<n)-1)a[i]=a[i]*sum%mod;
	FWT(a,n); //cout<<a[0]<<endl;
	memcpy(A,a,sizeof(A)); UFWT(A,n);
	For(i,0,(1<<n)-1){
		if(i==0){f[i]=1; }
		else f[i]=ksm(a[i]-1,mod-2); 
		//cout<<a[i]<<" "<<A[i]<<" "<<f[i]<<" "<<fd[i]<<endl;
	}
	UFWT(f,n);
	For(i,0,(1<<n)-1){
		//cout<<xs<<" "<<f[0]<<" "<<fd[0]<<" "<<f[i]<<" "<<fd[i]<<endl;
		writeln(((f[i]-f[0])%mod+mod)%mod);
	}
}