#include<bits/stdc++.h>
#define ll long long
#define inf 1010000000
#define infll 1010000000000000000ll
#define vi vector<int>
#define vll vector<ll>
#define pb push_back
#define pii pair<int,int>
#define pll pair<ll,ll>
#define pdd pair<double,double>
#define mpr make_pair
#define fi first
#define se second
#define pq priority_queue<int>
#define pqll priority_queue<ll>
#define up(x,y) (x<(y)?x=(y):0)
#define dn(x,y) (x>(y)?x=(y):0)
#define ad(x,y) (x=(x+(y))%mod)
#define N 2000009
#define mod 998244353
using namespace std;

int n,m,a[N];
void fwt(int *a){
	int i,j,k,x;
	for (k=1; k<m; k<<=1)
		for (i=0; i<m; i+=k<<1)
			for (j=i; j<i+k; j++){
				x=a[j];
				a[j]=(a[j]+a[j+k])%mod; a[j+k]=(x-a[j+k]+mod)%mod;
			}
}
int ksm(int x,int y){
	int ans=1; for (; y; y>>=1,x=(ll)x*x%mod) if (y&1) ans=(ll)ans*x%mod;
	return ans;
}
int main(){
	scanf("%d",&n); m=1<<n;
	int i,sum=0;
	for (i=0; i<m; i++){ scanf("%d",&a[i]); ad(sum,a[i]); }
	sum=ksm(sum,mod-2);
	for (i=0; i<m; i++) a[i]=(ll)a[i]*sum%mod;
	fwt(a);
	a[0]=0; for (i=1; i<m; i++) a[i]=ksm(a[i]-1+mod,mod-2);
	fwt(a);
	for (i=0; i<m; i++) printf("%d\n",(a[i]-a[0]+mod)%mod);
	return 0;
}
