/*
 　　　　　／＞　 フ
 　　　　　| 　_　 _|
 　 　　　／`ミ _x 彡
 　　 　 /　　　 　 |
 　　　 /　  ヽ　　 ?
 　／￣|　　 |　|　|
 　| (￣ヽ＿_ヽ_)_)
 　＼二つ
  */

#include <queue>
#include <vector>
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#define MP make_pair
#define ll long long
#define fi first
#define se second
using namespace std;

template <typename T>
void read(T &x) {
    x = 0; bool f = 0;
    char c = getchar();
    for (;!isdigit(c);c=getchar()) if (c=='-') f=1;
    for (;isdigit(c);c=getchar()) x=x*10+(c^48);
    if (f) x=-x;
}

template<typename F>
inline void write(F x, char ed = '\n') {
    static short st[30];short tp=0;
    if(x<0) putchar('-'),x=-x;
    do st[++tp]=x%10,x/=10; while(x);
    while(tp) putchar('0'|st[tp--]);
    putchar(ed);
}

template <typename T>
inline void Mx(T &x, T y) { x < y && (x = y); }

template <typename T>
inline void Mn(T &x, T y) { x > y && (x = y); }

const int N = 1000500;
const int P = 998244353;
ll fpw(ll x, ll mi) {
    ll res = 1;
    for (; mi; mi >>= 1, x = x * x % P)
        if (mi & 1) res = res * x % P;
    return res;
}
inline int add(int x, int y) {
    return x + y >= P ? x + y - P : x + y; 
}
int A[N], lim, n, inv2 = (P + 1) / 2;
void FWT_xor(int *A, int ty) {
    for (int i = 1;i < lim; i <<= 1) {
        for (int j = 0;j < lim; j += (i << 1)) {
            int *f = A + j, *g = f + i;
            for (int k = 0;k < i; k++) {
                int x = f[k], y = g[k];
                f[k] = add(x, y),  g[k] = add(x, P - y);
                if (ty == -1) f[k] = 1ll * f[k] * inv2 % P,
                    g[k] = 1ll * inv2 * g[k] % P;
            }
        }
    }
}

int p[N], S;
int main() {
    read(n), lim = 1 << n;
    for (int i = 0;i < lim; i++) read(p[i]), S += p[i];
    S = fpw(S, P - 2);
    for (int i = 0;i < lim; i++) p[i] = 1ll * p[i] * S % P;
        /* write(p[i], ' '); */
    /* puts(""); */
    FWT_xor(p, 1);
    for (int i = 0;i < lim; i++) {
        /* write(g[i], ' '), write(p[i]); */
        ll up = i == 0 ? 0 : lim, dw = (p[i] + P - 1) % P;
        /* write(up, ' '), write(dw); */
        A[i] = up * fpw(dw, P - 2) % P;
    }
    FWT_xor(A, -1);
    for (int i = 0;i < lim; i++) write(add(A[i], -A[0] + P));
    return 0;
}