#include<bits/stdc++.h>
using namespace std;

typedef long long lint;
typedef long double louble;

template<typename T1,typename T2> inline T1 max(T1 a,T2 b){return a<b?b:a;}
template<typename T1,typename T2> inline T1 min(T1 a,T2 b){return a<b?a:b;}

namespace ae86
{
	const int bufl = 1<<15;
	
	char buf[bufl],*s=buf,*t=buf;
	
	inline int fetch()
	{
		if(s==t){t=(s=buf)+fread(buf,1,bufl,stdin);if(s==t)return EOF;}
		return *s++;
	}
	
	inline int ty()
	{
		int a=0,b=1,c=fetch();
		while(!isdigit(c))b^=c=='-',c=fetch();
		while(isdigit(c))a=a*10+c-48,c=fetch();
		return b?a:-a;
	}
}
using ae86::ty;

const int _ = 1<<18 , mo = 998244353;

inline lint powa(lint a,lint t)
{
	lint b=1;
	while(t){if(t&1)b=b*a%mo;a=a*a%mo,t>>=1;}
	return b;
}

inline lint inva(lint a){return powa(a,mo-2);}

const int inv2 = inva(2);

inline void fwtxor(lint a[],int nn,int dir)
{
	for(int i=1;i<nn;i<<=1)
		for(int j=0;j<nn;j+=i+i)
			for(int k=0;k<i;k++)
			{
				lint x=a[j+k],y=a[j+k+i];
				a[j+k]=(x+y)%mo,a[j+k+i]=(x-y+mo)%mo;
				if(dir<0)a[j+k]=a[j+k]*inv2%mo,a[j+k+i]=a[j+k+i]*inv2%mo;
			}
}

int n,nn;
lint gai[_]={0},sgai=0;
lint f[_],g[_],h[_]={0};

int main()
{
	n=ty(),nn=1<<n;
	for(int i=0;i<nn;i++)gai[i]=ty(),sgai=(sgai+gai[i])%mo;
	for(int i=0,x=inva(sgai);i<nn;i++)gai[i]=gai[i]*x%mo;

	f[0]=(gai[0]-1+mo)%mo;
	for(int i=1;i<nn;i++)f[i]=gai[i];
	h[0]=(powa(2,n)-1+mo)%mo;
	for(int i=1;i<nn;i++)h[i]=mo-1;

	fwtxor(f,nn,1),fwtxor(h,nn,1);
	for(int i=0;i<nn;i++)g[i]=h[i]*inva(f[i])%mo;
	fwtxor(g,nn,-1);

	for(int i=0;i<nn;i++)printf("%lld\n",(g[i]-g[0]+mo)%mo);

	return 0;
}
