Snuke found a random number generator. It generates an integer between 0 and 2^N-1 (inclusive). An integer sequence A_0, A_1, \cdots, A_{2^N-1} represents the probability that each of these integers is generated. The integer i (0 \leq i \leq 2^N-1) is generated with probability A_i / S, where S = \sum_{i=0}^{2^N-1} A_i. The process of generating an integer is done independently each time the generator is executed.

Snuke has an integer X, which is now 0. He can perform the following operation any number of times:

* Generate an integer v with the generator and replace X with X \oplus v, where \oplus denotes the bitwise XOR.



For each integer i (0 \leq i \leq 2^N-1), find the expected number of operations until X becomes i, and print it modulo 998244353. More formally, represent the expected number of operations as an irreducible fraction P/Q. Then, there exists a unique integer R such that R \times Q \equiv P \mod 998244353,\ 0 \leq R < 998244353, so print this R.

We can prove that, for every i, the expected number of operations until X becomes i is a finite rational number, and its integer representation modulo 998244353 can be defined.

Constraints

* 1 \leq N \leq 18
* 1 \leq A_i \leq 1000
* All values in input are integers.

Input

Input is given from Standard Input in the following format:


N
A_0 A_1 \cdots A_{2^N-1}


Output

Print 2^N lines. The (i+1)-th line (0 \leq i \leq 2^N-1) should contain the expected number of operations until X becomes i, modulo 998244353.

Examples

Input

2
1 1 1 1


Output

0
4
4
4


Input

2
1 2 1 2


Output

0
499122180
4
499122180


Input

4
337 780 799 10 796 875 331 223 941 67 148 483 390 565 116 355


Output

0
468683018
635850749
96019779
657074071
24757563
745107950
665159588
551278361
143136064
557841197
185790407
988018173
247117461
129098626
789682908
#include <algorithm>  
#include <iostream>  
#include <sstream>  
#include <string>  
#include <cstring>
#include <vector>  
#include <queue>  
#include <set>  
#include <map>  
#include <cstdio>  
#include <cstdlib>  
#include <cctype>  
#include <cmath>  
#include <list>  
#include <cassert>
#include <ctime>
#include <climits>
using namespace std;  

#define PB push_back  
#define MP make_pair  
#define SZ(v) ((int)(v).size())  
#define FOR(i,a,b) for(int i=(a);i<(b);++i)  
#define REP(i,n) FOR(i,0,n)  
#define FORE(i,a,b) for(int i=(a);i<=(b);++i)  
#define REPE(i,n) FORE(i,0,n)  
#define FORSZ(i,a,v) FOR(i,a,SZ(v))  
#define REPSZ(i,v) REP(i,SZ(v))  
typedef long long ll;
typedef unsigned long long ull;
ll gcd(ll a,ll b) { return b==0?a:gcd(b,a%b); }

const int MAXN=18;
const int MOD=998244353;
void inc(int &a,int b) { if((a+=b)>=MOD) a-=MOD; }
void dec(int &a,int b) { if((a-=b)<0) a+=MOD; }
int pw(int x,int n) { int ret=1; while(true) { if(n&1) ret=(ll)ret*x%MOD; if((n>>=1)==0) return ret; x=(ll)x*x%MOD; } }
int inv(int x) { assert(x!=0); return pw(x,MOD-2); }

void wht(int *a,int nbits) {
	REP(bit,nbits) for(int off=0;off<(1<<nbits);off+=2<<bit) REP(i,1<<bit) { int x=a[off+i],y=a[off+(1<<bit)+i]; a[off+i]=a[off+(1<<bit)+i]=x; inc(a[off+i],y); dec(a[off+(1<<bit)+i],y); }
}

int n;
int a[1<<MAXN];
int x[1<<MAXN];

int p[1<<MAXN];
int lhs[1<<MAXN];
int rhs[1<<MAXN];


void solve() {
	int asum=0; REP(i,1<<n) asum+=a[i];
	int pmlt=inv(asum); REP(i,1<<n) p[i]=(ll)a[i]*pmlt%MOD;
	REP(i,1<<n) lhs[i]=p[i]; lhs[0]=(lhs[0]+MOD-1)%MOD;
	REP(i,1<<n) rhs[i]=MOD-1; rhs[0]=(rhs[0]+(1<<n))%MOD;
	wht(lhs,n);
	wht(rhs,n);
	//printf("lhs:"); REP(i,1<<n) printf(" %d",lhs[i]); puts("");
	//printf("rhs:"); REP(i,1<<n) printf(" %d",rhs[i]); puts("");
	x[0]=0; FOR(i,1,1<<n) { assert(lhs[i]!=0); x[i]=(ll)rhs[i]*inv(lhs[i])%MOD; }
	wht(x,n);
	int offset=MOD-x[0]; REP(i,1<<n) inc(x[i],offset);
	int xmlt=inv(1<<n); REP(i,1<<n) x[i]=(ll)x[i]*xmlt%MOD;
	//printf("x:"); REP(i,1<<n) printf(" %d",x[i]); puts("");
}

void run() {
	scanf("%d",&n);
	REP(i,1<<n) scanf("%d",&a[i]);
	solve();
	REP(i,1<<n) printf("%d\n",x[i]);

}

int main() {
	run();
	return 0;
}
