#include <bits/stdc++.h>
using namespace std;
const int maxn = (1 << 21) + 50;
int n, m;
char A[maxn], B[maxn];
unsigned long long a[maxn], b[maxn];
inline void fmt(unsigned long long a[]) {
  for (int i = 1; i < m; i <<= 1)
    for (int j = 0; j < m; j++)
      if (i & j) a[j] += a[i ^ j];
}
inline void dfmt(unsigned long long a[]) {
  for (int i = 1; i < m; i <<= 1)
    for (int j = 0; j < m; j++)
      if (i & j) a[j] -= a[i ^ j];
}
int main() {
  scanf("%d%s%s", &n, A, B);
  m = 1 << n;
  for (int i = 0; i < m; i++)
    a[i] = (A[i] - '0') * (1ull << (2 * __builtin_popcount(i))),
    b[i] = (B[i] - '0') * (1ull << (2 * __builtin_popcount(i)));
  fmt(a);
  fmt(b);
  for (int i = 0; i < m; i++) b[i] = a[i] * b[i];
  dfmt(b);
  for (int i = 0; i < m; i++)
    putchar('0' + ((b[i] >> (2 * __builtin_popcount(i))) & 3));
}
