#include #include #include using u64 = unsigned long long; u64 clmul(u64 x, u64 y) { u64 z = 0; for (int i = 0; i <= 31; i++) { for (int j = 0; j <= 31; j++) { z |= u64((x >> i) & (y >> j) & 1) << (i + j); } } return z; } int main() { int n; std::cin >> n; assert(n <= 10); std::vector A(1 << n, 0), B(1 << n, 0), C(1 << n, 0); for (auto &e : A) { for (int i = 0; i <= 31; i++) { int a; std::cin >> a; e |= u64(e) << i; } } for (auto &e : B) { for (int i = 0; i <= 31; i++) { int b; std::cin >> b; e |= u64(b) << i; } } for (int i = 0; i < (1 << n); i++) { for (int j = 0; j < (1 << n); j++) { C[i ^ j] ^= clmul(A[i], B[j]); } } for (const auto &e : C) { for (int i = 0; i <= 62; i++) { std::cout << (e >> i & 1) << " \n"[i == 62]; } } return 0; }