#include <bits/stdc++.h>
using namespace std;
const int Maxn=1<<18,mod=998244353;
int a[Maxn],p[Maxn],A[Maxn],B[Maxn];
int ksm(int x,int k){
    int ret=1,tmp=x;
    while(k){
        if(k&1)ret=1ll*ret*tmp%mod;
        tmp=1ll*tmp*tmp%mod;k>>=1;
    }
    return ret;
}
int inv(int x){return ksm(x,mod-2);}
void FWT(int*a,int n,int type){
    for(int l=2;l<=n;l<<=1)
        for(int*p=a,m=l>>1;p!=a+n;p+=l)
            for(int i=0;i<m;i++){
                int x=p[i],y=p[i+m];
                p[i]=(x+y)%mod;
                p[i+m]=(x-y)%mod;
                if(type==-1){
                    p[i]=1ll*p[i]*((mod+1)/2)%mod;
                    p[i+m]=1ll*p[i+m]*((mod+1)/2)%mod;
                }
            }
}
int main(){
    int n,sum=0;scanf("%d",&n);
    for(int i=0;i<1<<n;i++)scanf("%d",&p[i]);
    for(int i=0;i<1<<n;i++)sum=(sum+p[i])%mod;
    for(int i=0;i<1<<n;i++)p[i]=1ll*p[i]*inv(sum)%mod;
    for(int i=0;i<1<<n;i++)A[i]=p[i]-(i==0),B[i]=-1+(i==0)*(1<<n);
    FWT(A,1<<n,1);FWT(B,1<<n,1);
    for(int i=0;i<1<<n;i++)A[i]=1ll*B[i]*inv(A[i])%mod;
    FWT(A,1<<n,-1);
    for(int i=0;i<1<<n;i++)
        cout<<((A[i]-A[0])%mod+mod)%mod<<" \n"[i==(1<<n)-1];
    return 0;
}