#include <bits/stdc++.h>

const int mod = 998244353;
typedef long long LL;
void reduce(int & x) { x += x >> 31 & mod; }
int mul(int a, int b) { return (LL) a * b % mod; }
int fastpow(int a, int b, int res = 1) {
	for (; b; b >>= 1, a = mul(a, a)) if (b & 1) res = mul(res, a);
	return res;
}
int remod(LL x) { x %= mod; return x + (x >> 63 & mod); }
const int MAXN = 1 << 18;
int n, A[MAXN], tar[MAXN];
void FWT(int * A, int typ) {
	const int U = 1 << n;
	for (int mid = 1; mid != U; mid <<= 1)
		for (int k = 0; k != U; k += mid << 1)
			for (int l = 0; l != mid; ++l) {
				const int X = A[l + k], Y = A[l + k + mid];
				reduce(A[l + k] += Y - mod);
				reduce(A[l + k + mid] = X - Y);
			}
	if (typ == -1) {
		const int liminv = fastpow(U, mod - 2);
		for (int i = 0; i != U; ++i) A[i] = mul(A[i], liminv);
	}
}
int main() {
	std::ios_base::sync_with_stdio(false), std::cin.tie(0);
	std::cin >> n;
	const int U = 1 << n;
	tar[0] = U;
	for (int i = 0; i != U; ++i) reduce(tar[i] -= 1);
	for (int i = 0; i != U; ++i) std::cin >> A[i];
	int sa = fastpow(std::accumulate(A, A + U, 0ll) % mod, mod - 2);
	for (int i = 0; i != U; ++i) A[i] = mul(A[i], sa);
	reduce(A[0] -= 1);
	FWT(A, 1); FWT(tar, 1);
	for (int i = 0; i != U; ++i)
		A[i] = fastpow(A[i], mod - 2, tar[i]);
	FWT(A, -1);
	for (int i = U - 1; ~i; --i) reduce(A[i] -= A[0]);
	for (int i = 0; i != U; ++i)
		std::cout << A[i] << '\n';
	return 0;
}
