#include<bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
#define SZ(x) ((int)x.size())
#define L(i,u) for (register int i=head[u]; i; i=nxt[i])
#define rep(i,a,b) for (register int i=(a); i<=(b); i++)
#define per(i,a,b) for (register int i=(a); i>=(b); i--)
using namespace std;
typedef long long ll;
typedef unsigned int ui;
typedef pair<int,int> Pii;
typedef vector<int> Vi;
template<class T> inline void read(T &x){
	x=0; char c=getchar(); int f=1;
	while (!isdigit(c)) {if (c=='-') f=-1; c=getchar();}
	while (isdigit(c)) {x=x*10+c-'0'; c=getchar();} x*=f;
}
template<class T> inline void umin(T &x, T y){x=x<y?x:y;}
template<class T> inline void umax(T &x, T y){x=x>y?x:y;}
inline ui R() {
	static ui seed=416;
	return seed^=seed>>5,seed^=seed<<17,seed^=seed>>13;
}
const int N = 1<<18|3,mo=998244353,inv2=(mo+1)/2;
int n,a[N],all,g[N],f[N];
int power(int a, int n){
	int res=1;
	while(n){
		if(n&1)res=1LL*res*a%mo;a=1LL*a*a%mo;n>>=1;
	}
	return res;
}
inline void fwt(int *a, int n){
	for(int j=2;j<=n;j<<=1)
		for(int k=0;k<n;k+=j)rep(i,0,(j>>1)-1){
			int x=a[k+i],y=a[k+i+(j>>1)];
			a[k+i]=x+y<mo?x+y:x+y-mo;a[k+i+(j>>1)]=x-y>=0?x-y:x-y+mo;
		}
}
int main() {
	read(n);all=(1<<n)-1;
	int tot=0;rep(i,0,all)read(a[i]),tot=(tot+a[i])%mo;
	tot=power(tot,mo-2);rep(i,0,all)a[i]=1LL*a[i]*tot%mo;
	fwt(a,1<<n);rep(i,0,all)g[i]=power(1-a[i]+mo,mo-2);
//	rep(i,0,all)printf("%d:%d %d\n",i,a[i],g[i]);
	tot=0;rep(i,0,all)tot=(tot+g[i])%mo;
	fwt(g,1<<n);rep(i,0,all)f[i]=1LL*(tot-g[i]+mo)*inv2%mo;
	rep(i,0,all)f[i]=2LL*f[i]%mo,printf("%d\n",(f[i]+mo)%mo);
	return 0;
}
