#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (int)(n); i ++)
#define rep1(i, n) for(int i = 1; i <= (int)(n); i ++)
#define MP make_pair

using namespace std;
typedef long long LL;
typedef pair<int, int> PII;
const int MOD = 998244353;

int power(int x, int t)
{
	int ret = 1;
	while(t > 0) {
		if(t & 1) ret = 1LL * ret * x % MOD;
		x = 1LL * x * x % MOD;
		t >>= 1;
	}
	return ret;
}

void fwt(int n, int to[])
{
	rep(i, n) rep(j, 1 << n)
	if(j >> i & 1) {
		int lj = j ^ 1 << i;
		int d0 = to[lj], d1 = to[j];
		to[lj] = (d0 + d1) % MOD;
		to[j] = (d0 - d1 + MOD) % MOD;
	}
}

int n, a[262144];
int dat[2][262144], datd[2][262144];

int main()
{
	scanf("%d", &n);
	rep(i, 1 << n) scanf("%d", &a[i]);
	
	int sum = 0;
	rep(i, 1 << n) sum = (sum + a[i]) % MOD;
	sum = power(sum, MOD - 2);
	rep(i, 1 << n) a[i] = 1LL * a[i] * sum % MOD;
	fwt(n, a);
	
	rep(i, 1 << n) {
		if(a[i] == 1) dat[1][i] = 1;
		else dat[0][i] = power((1 - a[i] + MOD) % MOD, MOD - 2);
		if(a[i] == 1) datd[1][i] = 1;
		else datd[1][i] = 1LL * a[i] * power((1 - a[i] + MOD) % MOD, MOD - 3) % MOD;
	}
	
	fwt(n, dat[0]);
	fwt(n, dat[1]);
	fwt(n, datd[0]);
	fwt(n, datd[1]);
	
	rep(i, 1 << n) {
		int hv = (dat[0][0] - dat[0][i] + MOD) % MOD;
		printf("%d\n", hv);
	}
	
	return 0;
}