#include <bits/stdc++.h>
#define mod 998244353
using namespace std;
int read();
int M(int x) { return x >= mod ? x - mod : x; }
void Add(int& x, int y) { (x += y) >= mod ? x -= mod : x; }
int n, len, sp;
int fsp(long long bs, int p) {
    int rt = 1;
    while (p) {
        if (p & 1) rt = bs * rt % mod;
        bs = bs * bs % mod, p >>= 1;
    }
    return rt;
}

struct Poly {
    int x[300005];
    int& operator[](int p) { return x[p]; }
    void fwt(int len) {
        for (int l = 2; l <= len; l <<= 1)
            for (int i = 0, m = l >> 1; i < len; i += l)
                for (int j = i, t; j < i + m; ++j)
                    t = x[j + m], x[j + m] = M(x[j] - t + mod), Add(x[j], t);
    }
    void ifwt(int len) {
        fwt(len);
        int ny = fsp(len, mod - 2);
        for (int i = 0; i < len; ++i) x[i] = 1ll * x[i] * ny % mod;
    }
} E, P, S;

int main() {
    n = read(), len = 1 << n;
    for (int i = 0; i < len; ++i) sp += (P[i] = read());
    sp = fsp(sp, mod - 2);
    for (int i = 0; i < len; ++i) P[i] = 1ll * P[i] * sp % mod;
    (--P[0]) < 0 ? P[0] += mod : 0, S[0] = len - 1;
    for (int i = 1; i < len; ++i) S[i] = mod - 1;
    P.fwt(len), S.fwt(len);
    for (int i = 1; i < len; ++i) E[i] = 1ll * S[i] * fsp(P[i], mod - 2) % mod;
    E.ifwt(len);
    int x = mod - E[0];
    for (int i = 0; i < len; ++i) printf("%d\n", M(x + E[i]));

    return 0;
}
const int _SIZE = 1 << 22;
char ibuf[_SIZE], *iS = ibuf, *iT = ibuf;
#define gc                                                         \
    (iS == iT ? iT = ((iS = ibuf) + fread(ibuf, 1, _SIZE, stdin)), \
     (iS == iT ? EOF : *iS++) : *iS++)
int read() {
    int x = 0, f = 1;
    char c = gc;
    while (!isdigit(c)) f = (c == '-') ? -1 : f, c = gc;
    while (isdigit(c)) x = x * 10 + c - '0', c = gc;
    return x * f;
}