#include <bits/stdc++.h>
using namespace std;
const int mod = 998244353;
int n, w, a[1 << 18], b[1 << 18], c[1 << 18];

inline int add(int x, int y) {
	x += y; return x < mod ? x : x - mod;
}
inline int dec(int x, int y) {
	x -= y; return x < 0 ? x + mod : x;
}
inline int mul(int x, int y) {
	return 1ll * x * y % mod;
}
inline int fpow(int x, int y) {
	int ans = 1;
	while (y) {
		if (y & 1) ans = mul(ans, x);
		y >>= 1; x = mul(x, x);
	}
	return ans;
}

void fwt(int *a) {
	for (int i = 0; i < n; ++i)
		for (int j = 0; j < 1 << n; ++j)
			if (j >> i & 1) {
				int x = a[j ^ (1 << i)], y = a[j];
				a[j ^ (1 << i)] = add(x, y); a[j] = dec(x, y);
			}
}

int main() {
	scanf("%d", &n);
	for (int i = 0; i < 1 << n; ++i) {
		scanf("%d", &a[i]); w += a[i];
	}
	w = fpow(w, mod - 2);
	for (int i = 0; i < 1 << n; ++i) {
		a[i] = dec(0, mul(a[i], w));
		b[i] = 1;
	}
	c[0] = dec(0, 1 << n); 
	a[0] = add(a[0], 1);
	fwt(a); fwt(b); fwt(c);
	for (int i = 1; i < 1 << n; ++i) {
		a[i] = mul(add(b[i], c[i]), fpow(a[i], mod - 2));
		a[0] = dec(a[0], a[i]);
	}
	fwt(a);
	w = fpow(1 << n, mod - 2);
	for (int i = 0; i < 1 << n; ++i)
		printf("%d\n", mul(a[i], w));
}
