#include<bits/stdc++.h>
using namespace std;

#define int long long

#define rep(i,n) for(int i=0;i<(n);i++)
#define reps(i,a,b) for(int i=(a);i<(b);i++)
#define pb push_back
#define eb emplace_back
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second

using vint=vector<int>;
using pint=pair<int,int>;
using vpint=vector<pint>;

template<typename A,typename B>inline void chmin(A &a,B b){if(a>b)a=b;}
template<typename A,typename B>inline void chmax(A &a,B b){if(a<b)a=b;}

template<class A,class B>
ostream& operator<<(ostream& ost,const pair<A,B>&p){
    ost<<"{"<<p.first<<","<<p.second<<"}";
    return ost;
}

template<class T>
ostream& operator<<(ostream& ost,const vector<T>&v){
    ost<<"{";
    for(int i=0;i<v.size();i++){
        if(i)ost<<",";
        ost<<v[i];
    }
    ost<<"}";
    return ost;
}

template<uint32_t mod>
struct ModInt{
    uint32_t a;
    ModInt& s(uint32_t vv){
        a=vv<mod?vv:vv-mod;
        return *this;
    }

    ModInt(int64_t x=0){s(x%mod+mod);}

    ModInt& operator+=(const ModInt &x){return s(a+x.a);}
    ModInt& operator-=(const ModInt &x){return s(a+mod-x.a);}
    ModInt& operator*=(const ModInt &x){
        a=uint64_t(a)*x.a%mod;
        return *this;
    }
    ModInt& operator/=(const ModInt &x){
        *this*=x.inv();
        return *this;
    }

    ModInt operator+(const ModInt &x)const{return ModInt(*this)+=x;}
    ModInt operator-(const ModInt &x)const{return ModInt(*this)-=x;}
    ModInt operator*(const ModInt &x)const{return ModInt(*this)*=x;}
    ModInt operator/(const ModInt &x)const{return ModInt(*this)/=x;}
    bool operator==(const ModInt &x)const{return a==x.a;}
    bool operator!=(const ModInt &x)const{return a!=x.a;}
    bool operator<(const ModInt &x)const{return a<x.a;}

    ModInt operator-()const{return ModInt()-*this;}
    ModInt pow(int64_t n)const{
        ModInt res(1),x(*this);
        while(n){
            if(n&1)res*=x;
            x*=x;
            n>>=1;
        }
        return res;
    }

    ModInt inv()const{return pow(mod-2);}
};

template<uint32_t mod>
istream& operator>>(istream& in,const ModInt<mod>& a){
    return (in>>a.a);
}
template<uint32_t mod>
ostream& operator<<(ostream& out,const ModInt<mod>& a){
    return (out<<a.a);
}
using mint=ModInt<998244353>;


template<class T>
vector<T>FWHT(vector<T>f){
    for(int len=1;2*len<=f.size();len<<=1){
        for(int i=0;i<f.size();i+=2*len){
            for(int j=0;j<len;j++){
                T u=f[i+j];
                T v=f[i+j+len];
                f[i+j]=u+v;
                f[i+j+len]=u-v;
            }
        }
    }
    return f;
}

vector<mint>conv(vector<mint>A,vector<mint>B){
    A=FWHT(A);
    B=FWHT(B);
    rep(i,A.size())A[i]*=B[i];
    A=FWHT(A);
    rep(i,A.size())A[i]/=A.size();
    return A;
}

signed main(){
    int N;scanf("%lld",&N);
    vint A(1<<N);
    rep(i,1<<N)scanf("%lld",&A[i]);

    int S=accumulate(all(A),0ll);

    vector<mint>r(1<<N);
    mint in=mint(S).inv();
    rep(i,1<<N)r[i]=in*A[i];

    vector<mint>t=r;
    t[0]-=1;

    vector<mint>e(1<<N);
    e[0]=(1<<N)-1;
    for(int i=1;i<1<<N;i++)e[i]=-1;

    t=FWHT(t);
    e=FWHT(e);
    for(int i=1;i<1<<N;i++)e[i]/=t[i];
    
    //v=a+xb
    auto a=FWHT(e);
    rep(i,1<<N)a[i]/=1<<N;
    



    mint az;
    rep(i,1<<N)az+=r[i]*a[i];

    mint x=mint(1<<N)-1-az;

    rep(i,1<<N){
        mint tmp=a[i]+x;
        printf("%lld\n",(int)tmp.a);
    }
}

Measured memory_bytes: 8952