#include<bits/stdc++.h>
#define ll long long
#define ljc 998244353
#define ljc2 (998244354/2) 
using namespace std;
/*
*/
#ifdef emm
#define gc getchar
#endif
#ifndef emm
inline char gc(){
    static char now[1<<16],*S,*T;
    if (T==S){T=(S=now)+fread(now,1,1<<16,stdin);if (T==S) return EOF;}
    return *S++;
}
#endif
inline ll read(){
    register ll x=0,f=1;char ch=gc();
    while (!isdigit(ch)){if(ch=='-')f=-1;ch=gc();}
    while (isdigit(ch)){x=(x<<3)+(x<<1)+ch-'0';ch=gc();}
    return (f==1)?x:-x;
}
inline ll fast_pow(ll a,ll b,ll p){
	ll t=1;
	while (b){
		if (b&1ll) t=t*a%p;
		b>>=1;a=a*a%p; 
	}
	return t;
}
inline void FWT(ll *f,ll lim,ll id){
	for (int len=1;len<lim;len<<=1){
		for (int i=0;i<lim;i+=len<<1){
			ll *f1=f+i,*f2=f1+len;
			for (int j=0;j<len;j++){
				ll x=f1[j],y=f2[j];
				f1[j]=(x+y)*(~id?1:ljc2)%ljc;
				f2[j]=(x-y+ljc)*(~id?1:ljc2)%ljc;
			}
		}
	}
}
ll n,lim,a[1048577],S,b[1048577];
signed main(){
	n=read(),lim=1<<n;
	for (int i=0;i<lim;i++) a[i]=read(),S+=a[i];
	S=fast_pow(S%ljc,ljc-2,ljc);
	for (int i=1;i<lim;i++) b[i]=ljc-1;
	b[0]=lim-1;
	for (int i=1;i<lim;i++) a[i]=a[i]*S%ljc;
	a[0]=(a[0]*S%ljc+ljc-1)%ljc;
	FWT(b,lim,1),FWT(a,lim,1);
	for (int i=1;i<lim;i++) a[i]=fast_pow(a[i],ljc-2,ljc)*b[i]%ljc;
	a[0]=0;
	FWT(a,lim,-1);
	ll tmp=a[0];
	for (int i=0;i<lim;i++){
		printf("%lld\n",(a[i]-tmp+ljc)%ljc);
	}
	return 0;
}
### Prompt

Create a solution in Cpp for the following problem:

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

### Response

```cpp
#include<bits/stdc++.h>
#define ll long long
#define ljc 998244353
#define ljc2 (998244354/2) 
using namespace std;
/*
*/
#ifdef emm
#define gc getchar
#endif
#ifndef emm
inline char gc(){
    static char now[1<<16],*S,*T;
    if (T==S){T=(S=now)+fread(now,1,1<<16,stdin);if (T==S) return EOF;}
    return *S++;
}
#endif
inline ll read(){
    register ll x=0,f=1;char ch=gc();
    while (!isdigit(ch)){if(ch=='-')f=-1;ch=gc();}
    while (isdigit(ch)){x=(x<<3)+(x<<1)+ch-'0';ch=gc();}
    return (f==1)?x:-x;
}
inline ll fast_pow(ll a,ll b,ll p){
	ll t=1;
	while (b){
		if (b&1ll) t=t*a%p;
		b>>=1;a=a*a%p; 
	}
	return t;
}
inline void FWT(ll *f,ll lim,ll id){
	for (int len=1;len<lim;len<<=1){
		for (int i=0;i<lim;i+=len<<1){
			ll *f1=f+i,*f2=f1+len;
			for (int j=0;j<len;j++){
				ll x=f1[j],y=f2[j];
				f1[j]=(x+y)*(~id?1:ljc2)%ljc;
				f2[j]=(x-y+ljc)*(~id?1:ljc2)%ljc;
			}
		}
	}
}
ll n,lim,a[1048577],S,b[1048577];
signed main(){
	n=read(),lim=1<<n;
	for (int i=0;i<lim;i++) a[i]=read(),S+=a[i];
	S=fast_pow(S%ljc,ljc-2,ljc);
	for (int i=1;i<lim;i++) b[i]=ljc-1;
	b[0]=lim-1;
	for (int i=1;i<lim;i++) a[i]=a[i]*S%ljc;
	a[0]=(a[0]*S%ljc+ljc-1)%ljc;
	FWT(b,lim,1),FWT(a,lim,1);
	for (int i=1;i<lim;i++) a[i]=fast_pow(a[i],ljc-2,ljc)*b[i]%ljc;
	a[0]=0;
	FWT(a,lim,-1);
	ll tmp=a[0];
	for (int i=0;i<lim;i++){
		printf("%lld\n",(a[i]-tmp+ljc)%ljc);
	}
	return 0;
}
```