// This amazing code is by Eric Sunli Chen.
#include<bits/stdc++.h>
using namespace std;
template<typename T> bool get_int(T &x)
{
	char t=getchar();
	bool neg=false;
	x=0;
	for(; (t>'9'||t<'0')&&t!='-'&&t!=EOF; t=getchar());
	if(t=='-')neg=true,t=getchar();if(t==EOF)return false;
	for(; t<='9'&&t>='0'; t=getchar())x=x*10+t-'0';
	if(neg)x=-x;return true;
}
template<typename T> void print_int(T x)
{
	if(x<0)putchar('-'),x=-x;
	short a[20]= {},sz=0;
	while(x>0)a[sz++]=x%10,x/=10;
	if(sz==0)putchar('0');
	for(int i=sz-1; i>=0; i--)putchar('0'+a[i]);
}
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define get1(a) get_int(a)
#define get2(a,b) (get1(a)&&get1(b))
#define get3(a,b,c) (get1(a)&&get2(b,c))
#define printendl(a) print_int(a),puts("")
typedef long long LL;
typedef unsigned long long uLL;
typedef pair<int,int> pii;
const int inf=0x3f3f3f3f;
const LL Linf=1ll<<61;
const double pi=acos(-1.0);

const int mod=998244353;
const int maxn=1<<18;
int qpow(int x,int y)
{
	int ret=1;
	while(y)
	{
		if(y&1)ret=(LL)ret*x%mod;
		x=(LL)x*x%mod;
		y>>=1;
	}
	return ret;
}
int rv;
void fwt(int *a,int n,bool f=0)
{
	int sz=(1<<n);
	for(int k=1;k<sz;k<<=1)
	{
		for(int i=0;i<sz;i+=(k<<1))for(int j=0;j<k;j++)
		{
			int u=a[i+j],v=a[i+j+k];
			a[i+j]=u+v;if(a[i+j]>=mod)a[i+j]-=mod;
			a[i+j+k]=u-v;if(a[i+j+k]<0)a[i+j+k]+=mod;
		}
	}
	if(f)for(int i=0;i<sz;i++)a[i]=1ll*a[i]*rv%mod;
}
int f[maxn],n,g[maxn];

int main()
{
	get1(n);
	int sum=0;
	for(int i=0;i<(1<<n);i++)
	{
		get1(f[i]);
		sum+=f[i];
	}
	
	sum=qpow(sum,mod-2);
	for(int i=0;i<(1<<n);i++)f[i]=(LL)f[i]*sum%mod;
	if(f[0])f[0]--;else f[0]=mod-1;
	fwt(f,n);
	
	rv=qpow(1<<n,mod-2);
	for(int i=1;i<(1<<n);i++)f[i]=((LL)qpow(f[i],mod-2)<<n)%mod;
	
	int k0,k1;
	memcpy(g,f,sizeof(f));g[0]=0;fwt(g,n,1);k0=g[0];
	memcpy(g,f,sizeof(f));g[0]=1;fwt(g,n,1);k1=g[0];
	f[0]=(LL)k0*qpow((k0-k1+mod)%mod,mod-2)%mod;fwt(f,n,1);
	for(int i=0;i<(1<<n);i++)printendl(f[i]);
	
	return 0;
}