#include <bits/stdc++.h>
using namespace std;
int n, nn;
char s[2221000];
unsigned long long A[2221000], B[2221000];
int siz[2221000];
inline void FWT(unsigned long long *a) {
  for (int i = 1; i < nn; i <<= 1)
    for (int j = 0; j < nn; j += (i << 1))
      for (int k = 0; k < i; ++k) a[i + j + k] += a[j + k];
}
inline void IFWT(unsigned long long *a) {
  for (int i = 1; i < nn; i <<= 1)
    for (int j = 0; j < nn; j += (i << 1))
      for (int k = 0; k < i; ++k) a[i + j + k] -= a[j + k];
}
int main() {
  scanf("%d", &n);
  nn = 1 << n;
  scanf("%s", s);
  for (int i = 0; i < nn; ++i) A[i] = s[i] ^ 48;
  scanf("%s", s);
  for (int i = 0; i < nn; ++i) B[i] = s[i] ^ 48;
  for (int i = 1; i < nn; ++i)
    siz[i] = siz[i >> 1] + (i & 1), A[i] <<= (siz[i] << 1),
    B[i] <<= (siz[i] << 1);
  FWT(A), FWT(B);
  for (int i = 0; i < nn; ++i) A[i] = A[i] * B[i];
  IFWT(A);
  for (int i = 0; i < nn; ++i) putchar(((A[i] >> (siz[i] << 1)) & 3) ^ 48);
  puts("");
  return 0;
}
