#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstring>
using namespace std;
const int Mod=998244353;
const int inv2=499122177;
int fpow(int a,int b)
{
	int ans=1,t=a;
	while(b)
	{
		if(b&1)ans=1ll*ans*t%Mod;
		t=1ll*t*t%Mod;
		b>>=1;
	}
	return ans;
}
void fwt(int* a,int n,int dft)
{
	for(int step=1;step<n;step<<=1)
		for(int i=0;i<n;i+=step<<1)
			for(int j=i;j<i+step;j++)
			{
				int x=a[j],y=a[j+step];
				a[j]=(x+y)%Mod;a[j+step]=(x-y+Mod)%Mod;
				if(dft==-1)a[j]=1ll*a[j]*inv2%Mod,a[j+step]=1ll*a[j+step]*inv2%Mod;
			}
	return ;
}
int f[300010],p[300010];
int main()
{
	int n;scanf("%d",&n);
	n=1<<n;
	int S=0;
	for(int i=0;i<n;i++){
		scanf("%d",&p[i]);
		S+=p[i];
	}
	S=fpow(S,Mod-2);
	for(int i=0;i<n;i++)p[i]=1ll*p[i]*S%Mod;
	p[0]=(p[0]-1+Mod)%Mod;
	for(int i=1;i<n;i++)f[i]=Mod-1;
	f[0]=n-1;
	fwt(f,n,1);fwt(p,n,1);
	for(int i=1;i<n;i++)
		f[i]=1ll*f[i]*fpow(p[i],Mod-2)%Mod;
	f[0]=0;
	fwt(f,n,-1);
	int add=(Mod-f[0])%Mod;
	for(int i=0;i<n;i++)
		printf("%d\n",(f[i]+add)%Mod);
	return 0;
}