#include <iostream>
#include <map>
#include <set>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <fstream>
#include <bitset>
#include <queue>
#include <stack>
#include <deque>
#include <complex>
#include <iomanip>
#include <stdio.h>
#include <string.h>
#include <random>
#include <functional>

using std::cin;
using std::cout;
using std::cerr;
using std::endl;

using std::map;
using std::set;
using std::bitset;
using std::vector;
using std::string;
using std::multimap;
using std::multiset;
using std::deque;
using std::queue;
using std::stack;
using std::pair;
using std::iterator;

using std::sort;
using std::stable_sort;
using std::reverse;
using std::max_element;
using std::min_element;
using std::unique;
using std::ios_base;
using std::swap;
using std::fill;

using std::setprecision;
using std::fixed;

using std::complex;

long long min(long long a, long long b) {return a < b ? a : b;}
long long min(int a, long long b) {return a < b ? a : b;}
long long min(long long a, int b) {return a < b ? a : b;}
long long min(int a, int b) {return a < b ? a : b;}

long long max(long long a, long long b) {return a > b ? a : b;}
long long max(int a, long long b) {return a > b ? a : b;}
long long max(long long a, int b) {return a > b ? a : b;}
long long max(int a, int b) {return a > b ? a : b;}

#define int long long

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<long long> vl;
typedef string S;
typedef complex<double> cd;

#define F(i, n) for (int (i) = 0; (i) != (n); (i)++)
#define fi first
#define se second
#define re return
#define all(x) (x).begin(), (x).end()

const long long MOD = 998244353;
const long long rev2 = (MOD + 1) / 2;

int n, s;
int a[500000];

ll inq(ll x, ll y)
{
    if (!y) return 1;
    ll l = inq(x, y / 2);
    if (y % 2) return l * l % MOD * x % MOD;
    return l * l % MOD;
}

vector<int> solve(vector<int> b, vector<int> z)
{
    int n = b.size();
    if (n == 1)
    {
        if (b[0] == 0 && z[0] == 0)
        {
            return {1};
        }
        return {z[0] * inq(b[0], MOD - 2) % MOD};
    }
    vector<int> b0(n / 2), b1(n / 2), z0(n / 2), z1(n / 2);
    for (int i = 0; i < n / 2; i++)
    {
        b0[i] = (b[2 * i] + b[2 * i + 1]) % MOD;
        z0[i] = (z[2 * i] + z[2 * i + 1]) % MOD;
        b1[i] = (b[2 * i] - b[2 * i + 1] + MOD) % MOD;
        z1[i] = (z[2 * i] - z[2 * i + 1] + MOD) % MOD;
    }
    vector<int> x0 = solve(b0, z0), x1 = solve(b1, z1);
    vector<int> x(n);
    for (int i = 0; i < n / 2; i++)
    {
        x[2 * i] = (x0[i] + x1[i]) * rev2 % MOD;
        x[2 * i + 1] = (x0[i] + MOD - x1[i]) * rev2 % MOD;
    }
    return x;
}

signed main()
{
    srand(time(NULL));
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cin >> n;
    for (int i = 0; i < (1 << n); i++)
    {
        cin >> a[i];
        s += a[i];
    }
    vector<int> p(1 << n), z(1 << n);
    for (int i = 0; i < (1 << n); i++)
    {
        p[i] = a[i] * inq(s, MOD - 2) % MOD;
        z[i] = MOD - 1;
    }
    z[0] = (1 << n) - 1;
    p[0] = (p[0] + MOD - 1) % MOD;
    vector<int> x = solve(p, z);
    for (int i = 0; i < (1 << n); i++)
    {
        cout << (x[i] - x[0] + MOD) % MOD << "\n";
    }
}


Measured memory_bytes: 24932