#include<bits/stdc++.h> #define pct(x) __builtin_popcount(x) using LL = longlong; constint N = (1 << 20) + 100, P = 1e9 + 9, BT = 20 + 5; int bit, n, f[BT][N], g[BT][N], h[BT][N]; voidadj(int &x){ x += (x >> 31) & P; } voidfwt(int x[], int len) { for (int i = 2; i <= len; i <<= 1) for (int mid = i >> 1, j = 0; j < len; j += i) for (int k = j; k < j + mid; ++k) adj(x[k + mid] += x[k] - P); } voidufwt(int x[], int len) { for (int i = 2; i <= len; i <<= 1) for (int mid = i >> 1, j = 0; j < len; j += i) for (int k = j; k < j + mid; ++k) adj(x[k + mid] -= x[k]); } intmain() { scanf("%d", &bit), n = (1 << bit); for (int i = 0; i < n; ++i) scanf("%d", &f[pct(i)][i]); for (int i = 0; i < n; ++i) scanf("%d", &g[pct(i)][i]); for (int i = 0; i <= bit; ++i) fwt(f[i], n), fwt(g[i], n); for (int i = 0; i <= bit; ++i) for (int j = 0; j + i <= bit; ++j) for (int s = 0; s < n; ++s) adj(h[i + j][s] += LL(f[i][s]) * g[j][s] % P - P); for (int i = 0; i <= bit; ++i) ufwt(h[i], n); for (int i = 0; i < n; ++i) printf("%d ", h[pct(i)][i]); return0; }