#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const long long INF = 0x3f3f3f3f3f3f3f3f;
const int L = 1e6;
char buf[L], *bs, *bt;
char fr() {
  if (bs == bt) {
    bt = (bs = buf) + fread(buf, 1, L, stdin);
    if (bs == bt) return EOF;
  }
  return *bs++;
}
template <class T>
T read() {
  T x = 0, f = 1;
  char c = fr();
  for (; !isdigit(c); c = fr())
    if (c == '-') f = -1;
  for (; isdigit(c); c = fr()) x = 10 * x + c - 48;
  return x * f;
}
const int M = 21, N = 1 << M;
int n, m, bit[N + 7];
int bits(int x) {
  return (x == 0) ? 0 : bit[x] ? bit[x] : (bit[x] = bits(x - (x & -x)) + 1);
}
void fwt(long long f[], int t) {
  for (int mid = 1; mid < n; mid <<= 1)
    for (int i = 0; i < n; i += mid << 1)
      for (int j = i; j < mid + i; j++) f[mid + j] += f[j] * t;
}
long long f[N + 7], g[N + 7], ans[N + 7];
int main() {
  n = 1 << (m = read<int>());
  for (int i = 0, c; i < n; i++) {
    while (!isdigit(c = fr()))
      ;
    f[i] = (15ll & c) << (bits(i) << 1);
  }
  for (int i = 0, c; i < n; i++) {
    while (!isdigit(c = fr()))
      ;
    g[i] = (15ll & c) << (bits(i) << 1);
  }
  fwt(f, 1), fwt(g, 1);
  for (int i = 0; i < n; i++) ans[i] = f[i] * g[i];
  fwt(ans, -1);
  for (int i = 0; i < n; i++) printf("%lld", (ans[i] >> (bits(i) << 1)) & 3);
  putchar('\n');
  return 0;
}
