#include<cstdio> usingnamespace std; template <classType> voidread(Type &x) { char c; bool flag = false; while ((c = getchar()) < '0' || c > '9') flag |= c == '-'; x = c - '0'; while ((c = getchar()) >= '0' && c <= '9') x = (x << 3) + (x << 1) + c - '0'; if (flag) x = ~x + 1; } template <classType, class ...Rest> voidread(Type &x, Rest &...y){ read(x); read(y...); } template <classType> voidwrite(Type x) { if (x < 0) putchar('-'), x = ~x + 1; if (x > 9) write(x / 10); putchar('0' + x % 10); } typedeflonglong LL; constint N = 1 << 18, mod = 998244353, inv2 = 499122177; int n, m, w[N], v[N]; intbinpow(int b, int k = mod - 2) { int res = 1; for (; k; k >>= 1, b = (LL)b * b % mod) if (k & 1) res = (LL)res * b % mod; return res; } voidfwt(int *x, int op) { for (int mid = 1; mid < m; mid <<= 1) for (int i = 0; i < m; i += mid << 1) for (int j = 0; j < mid; ++j) { int p = x[i | j], q = x[i | mid | j]; x[i | j] = (LL)op * (p + q) % mod, x[i | mid | j] = (LL)op * (p - q) % mod; } } intmain() { read(n); m = 1 << n; int sp = 0; for (int i = 0; i < m; ++i) read(w[i]), sp += w[i]; sp = binpow(sp); for (int i = 0; i < m; ++i) w[i] = (LL)w[i] * sp % mod; --w[0], v[0] = m - 1; for (int i = 1; i < m; ++i) v[i] = -1; fwt(w, 1), fwt(v, 1); w[0] = 0; for (int i = 1; i < m; ++i) w[i] = (LL)binpow(w[i]) * v[i] % mod; fwt(w, inv2); int t = w[0]; for (int i = 0; i < m; ++i) write((((LL)w[i] - t) % mod + mod) % mod), puts(""); return0; }