#include <stdio.h>
#include <stdlib.h>

#define P (5*(1<<25)+1)
#define MAXLEN 5000000
#define DROOT 243
#define IROOT 114609789  //=243^(2^25 -1);
// #define MASKL ((1<<14)-1)

long int a[MAXLEN],b[MAXLEN],rev[MAXLEN],wr[25];
int n,k;

/*
long int mult(long int x,long int y){
    long int lx,hx,ly,hy,lz,hz,mz,f0,f1,r,P;
    P=P1;
    lx=x & MASKL; hx=(x>>14);
    ly=y & MASKL; hy=(y>>14);
    lz=(lx*ly)%P;hz=(hx*hy)%P;
    mz=(hx*ly+lx*hy)%P;
    hz=(hz+(mz>>14))%P;
    lz=(lz+((mz&MASKL)*(1<<14)%P))%P;
    f0=hz%5; f1=(hz-f0)/5;
    r=(lz-8*f1+P-f0)%P + ((3*f0)*(1<<25))%P;
    return (r%P);
}
*/

long int mult(long int x,long int y){
    long long int r1,pm,xr,yr;
    long int r;
    xr=x; yr=y;
    pm=P;
    r1= xr*yr;
    r=(r1%pm);
 return r;
}


void proots(){
    int i;
    long int w0= IROOT; // DROOT;
    long int w1;
        for(i=0;i<25;i++){
            wr[24-i]=w0;
            w1=mult(w0,w0);
            w0=w1;
    }
}


void fftmod(){
    int s,m,l,i,j,mp,sdi;
    long int u,t,w0,w;

    rev[0]=0; sdi=1;
    for(i=0;i<k;i++){
        for(j=0;j<sdi;j++){
	    rev[j]=2*rev[j];
	    rev[j+sdi]=rev[j]+1;
        }
        sdi*=2;
    }

    for(i=0;i<n;i++) a[i]=b[rev[i]];

    for(s=1;s<=k;s++){
        mp=(1<<(s-1));
        m=mp*2;
        w0=wr[s-1];
        w=1;
        for(j=0;j<mp;j++){
            for(l=j;l<n;l+=m){
                t=mult(w,a[l+mp]);
                u=a[l];
                a[l]=(u+t)%P;
                a[l+mp]=(P+u-t)%P;

            }
            w=mult(w,w0);
        }
    }
}

/*
void inpassw(){
    long int x,y,sd;
    long int z;
    int i;
    FILE *fp1;
    sd=(1<<12);
    srand(time(NULL));
    fp1=fopen("password24.in","w");
    fprintf(fp1,"%d\n",21);
    x=rand();y=rand();
    z=mult(x,sd);
    z=(mult(z,z)+y)%P;
    fprintf(fp1,"%d",z);
    for(i=1;i<sd*sd;i++){
        x=rand();y=rand();
        z=mult(x,sd);
        z=(mult(z,z)+y)%P;
        fprintf(fp1," %d",z);
    }
    fclose(fp1);
}
*/

void directcalc(){
    int i,j;
    long int ws;
    ws=1;
    for(i=0;i<n;i++){
        a[i]=b[n-1];
        for(j=n-2;j>=0;j--){
            a[i]=(mult(a[i],ws)+b[j])%P;
        }
        ws=mult(ws,wr[k-1]);
    }
}


int main() {
    int i;
    long int Q;
    //FILE *fp, *fpin;

    // inpassw();
    proots();

   // fpin=fopen("password.in","r");
    scanf("%d",&k);
    n=(1<<k);
    for(i=0;i<n;i++) scanf("%ld",&b[i]);
    //fclose(fpin);

   //directcalc();

    fftmod();

    Q=P- 5*(1<<(25-k)); // Q * 2^k =1(mod P)
    //fp=fopen("password.out","w");
    //fprintf(fp,"%d\n",k);
    printf("%ld",mult(a[0],Q));     for(i=1;i<n;i++) printf(" %ld",mult(a[i],Q));
    //fprintf(fp,"%d",a[0]);        for(i=1;i<n;i++) fprintf(fp," %d",a[i]);
    //fclose(fp);
    //printf("END! \n\n");
    return 0;
}
