#include<bits/stdc++.h>
#define maxn 1<<18|5
#define mod 998244353
#define rep(i,j,k) for(int i=(j),LIM=(k);i<=LIM;i++)
#define per(i,j,k) for(int i=(j),LIM=(k);i>=LIM;i--)
using namespace std;

int n,N;
int a[maxn],b[maxn];

int Pow(int b,int k){ int r=1;for(;k;k>>=1,b=1ll*b*b%mod) if(k&1) r=1ll*r*b%mod; return r; }
void FWT(int *a){
	rep(i,0,n-1) rep(j,0,N-1) if(!(j>>i&1)){
		int v = j ^ (1 << i) , x = (a[j] + a[v]) % mod , y = (a[j] - a[v]) % mod;
		a[j] = x , a[v] = y;
	}
}

int main(){
	scanf("%d",&n);N = 1 << n;int S=0;
	rep(i,0,N-1) scanf("%d",&a[i]),S+=a[i];
	S = Pow(S , mod-2);
	rep(i,0,N-1) a[i] = 1ll * a[i] * S % mod;
	a[0]-- , b[0] = 1 << n;
	rep(i,0,N-1) b[i]--;
	FWT(a),FWT(b);
	rep(i,0,N-1) a[i] = 1ll * Pow(a[i],mod-2) * b[i] % mod;
	FWT(a);int ivN = Pow(N , mod-2);
	rep(i,0,N-1) a[i] = 1ll * a[i] * ivN % mod;
	per(i,N-1,0) a[i] = (a[i] - a[0]) % mod;
	rep(i,0,N-1) printf("%d\n",(a[i]+mod)%mod);
}