/****************************************************************
*	Author: huhao
*	Email: 826538400@qq.com
*	Create time: 2020-01-21 18:55:57
****************************************************************/
#include<stdio.h>
#include<string.h>
#include<math.h>
#include<algorithm>
#define fr(i,a,b) for(int i=(a),end_##i=(b);i<=end_##i;i++)
#define fd(i,a,b) for(int i=(a),end_##i=(b);i>=end_##i;i--)
int read()
{
	int r=0,t=1,c=getchar();
	while(c<'0'||c>'9')
	{
		t=c=='-'?-1:1;
		c=getchar();
	}
	while(c>='0'&&c<='9')
	{
		r=(r<<3)+(r<<1)+(c^48);
		c=getchar();
	}
	return r*t;
}
#define i64 long long
const int N=(1<<18)|10,mod=998244353;
i64 power(i64 a,i64 b,i64 p)
{
	i64 r=1; a%=p;
	while(b)
	{
		if(b&1) r=r*a%p;
		a=a*a%p; b>>=1;
	}
	return r;
}
i64 inv(i64 a){ return power(a,mod-2,mod); }
i64 n,f[N],g[N],s;
void fwt(i64 *a,i64 n,i64 opt)
{
	fr(i,0,n-1) for(int j=0;j<(1<<n);j+=(1<<(i+1))) fr(k,0,(1<<i)-1)
	{
		i64 x=a[j+k],y=a[j+k+(1<<i)];
		a[j+k]=(x+y)%mod; a[j+k+(1<<i)]=(x-y+mod)%mod;
	}
	if(opt==-1)
	{
		i64 I=inv(1<<n);
		fr(i,0,(1<<n)-1) a[i]=a[i]*I%mod;
	}
}
int main()
{
	n=read();
	fr(i,0,(1<<n)-1) s=(s+(g[i]=read()))%mod;
	fr(i,0,(1<<n)-1) g[i]=g[i]*inv(s)%mod;
	g[0]=g[0]?g[0]-1:mod-1;
	fwt(g,n,1);
/*	fr(i,0,(1<<n)-1) f[i]=read();
//	fr(i,0,(1<<n)-1) printf("%d%c",int(f[i]),i==end_i?'\n':' '); // 0 4 4 4
	fwt(f,n,1);
	fr(i,0,(1<<n)-1) printf("%d%c",int(f[i]),i==end_i?'\n':' '); // 12 -4 -4 -4
	fr(i,0,(1<<n)-1) f[i]=f[i]*g[i]%mod;
//	fwt(f,n,-1);
//	fr(i,0,(1<<n)-1) printf("%d%c",int(f[i]),i==end_i?'\n':' '); // 0 4 4 4
	return 0;*/
	fr(i,1,(1<<n)-1) f[0]=(f[0]-(f[i]=(1<<n)*inv(g[i])%mod)+mod)%mod;
	fwt(f,n,-1);
	fr(i,0,(1<<n)-1) printf("%d\n",int(f[i]));
	return 0;
}