#ifndef LOCAL
#pragma GCC optimize("O3")
#endif
#include <bits/stdc++.h>
using namespace std;
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
    *this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "

typedef long long ll;

const int mod = 998244353;


int sub(int a, int b) {
	a -= b;
	if(a < 0) {
		a += mod;
	}
	return a;
}
int add(int a, int b) {
	a += b;
	if(a >= mod) {
		a -= mod;
	}
	return a;
}

int mul(int a, int b) {
	return (ll) a * b % mod;
}
int my_pow(int a, int b) {
	int r = 1;
	while(b) {
		if(b % 2) {
			r = mul(r, a);
		}
		a = mul(a, a);
		b /= 2;
	}
	return r;
}
int my_inv(int a) {
	return my_pow(a, mod - 2);
}
#define div div_compile
int div(int a, int b) {
	if(b == 0) {
		debug() << "div " imie(a) imie(b);
	}
	if(b == 0) {
		return 0;
		// int ple = 0;
		// for(int x : {0,
// 468683018,
// 635850749,
// 96019779,
// 657074071,
// 24757563,
// 745107950,
// 665159588,
// 551278361,
// 143136064,
// 557841197,
// 185790407,
// 988018173,
// 247117461,
// 129098626,
// 789682908}) ple = add(ple, x);
		// return ple%mod;
	}
	return mul(a, my_inv(b));
}


int Z;

const int INV_TWO = my_inv(2);

pair<int,int> add(const pair<int,int>& a, const pair<int,int>& b) {
	return make_pair(add(a.first, b.first), add(a.second, b.second));
}

pair<int,int> sub(const pair<int,int>& a, const pair<int,int>& b) {
	return make_pair(sub(a.first, b.first), sub(a.second, b.second));
}

vector<pair<int,int>> solve(int c, vector<int> p, bool spec = false) {
	debug() << imie(c) imie(p);
	int n = p.size();
	/*
	if(n == 2 && spec) {
		debug() << "hacku hacku" imie(p) imie(c);
		// x[1] = A*x[0] + B
		int A = div(p[1], sub(1, p[0]));
		int B = div(c, sub(1, p[0]));
		debug() << imie(A) imie(B);
		// x[0] = C + p[0]*x[0] + p[1]*(A*x[0]+B) - Z
		int C = sub(1, add(p[0], mul(p[1], A)));
		int D = add(1, mul(p[1], B));
		D = sub(D, Z);
		debug() << imie(C) imie(D);
		// C * x[0] = D
		vector<int> x(2);
		x[0] = div(D, C);
		x[1] = add(mul(A, x[0]), B);
		return x;
	}
	*/
	if(n == 1) {
		vector<pair<int,int>> v;
		if(1 == p[0]) {
			v.emplace_back(0, 1);
		}
		else {
			v.emplace_back(div(sub(c, Z), sub(1, p[0])), 0);
		}
		return v;
	}
	vector<int> p_sum(n / 2), p_diff(n / 2);
	for(int i = 0; i < n / 2; ++i) {
		p_sum[i] = add(p[2*i], p[2*i+1]);
		p_diff[i] = sub(p[2*i], p[2*i+1]);
	}
	vector<pair<int,int>> x_sum = solve(add(c, c), p_sum, spec);
	vector<pair<int,int>> x_diff = solve(0, p_diff);
	
	vector<pair<int,int>> x(n);
	for(int i = 0; i < n / 2; ++i) {
		pair<int,int> sum = x_sum[i];
		pair<int,int> diff = x_diff[i];
		x[2*i] = add(sum, diff);
		x[2*i+1] = sub(sum, diff);
		for(int j : {2*i, 2*i+1}) {
			if(x[j].first) {
				x[j].first = mul(x[j].first, INV_TWO);
			}
			if(x[j].second) {
				x[j].second = mul(x[j].second, INV_TWO);
			}
		}
	}
	debug() << imie(n) imie(x_sum) imie(x_diff) imie(x);
	
	return x;
}

int main() {
	int n;
	scanf("%d", &n);
	Z = (1 << n);
	vector<int> p(1 << n);
	int sum = 0;
	for(int& x : p) {
		scanf("%d", &x);
		sum = add(sum, x);
	}
	int inv_sum = my_inv(sum);
	for(int& x : p) {
		x = mul(x, inv_sum);
	}
	debug() << imie(p);
	vector<pair<int,int>> answer = solve(1, p, true);
	debug() << imie(answer);
	int one = 0, two = 0;
	for(pair<int,int> p : answer) {
		one = add(one, p.first);
		two = add(two, p.second);
	}
	debug() << imie(one) imie(two);
	// 0 = answer[0].first * S + answer[0].second
	int S = div(sub(0, answer[0].first), answer[0].second);
	// int S = (499122180*2+4)%mod; //div(one, sub(1, two));
	for(pair<int,int> p : answer) {
		printf("%d\n", add(p.first, mul(p.second, S)));
	}
	// for(int x : answer) {
		// printf("%d\n", x);
	// }
}


Measured memory_bytes: 9312