#include <bits/stdc++.h>
using namespace std;
const int N = (1 << 21) + 5;
void fwt(long long *a, int n, int o) {
  for (int len = 2; len <= n; len <<= 1)
    for (int j = 0; j < n; j += len)
      for (int k = j; k < j + (len >> 1); k++) a[k + (len >> 1)] += a[k] * o;
}
int n;
long long a[N], b[N];
char ch;
int main() {
  scanf("%d", &n);
  n = (1 << n);
  for (int i = 0; i < n; i++) {
    scanf("%1lld", &a[i]);
    long long k = 2 * __builtin_popcount(i);
    a[i] <<= k;
  }
  for (int i = 0; i < n; i++) {
    scanf("%1lld", &b[i]);
    long long k = 2 * __builtin_popcount(i);
    b[i] <<= k;
  }
  fwt(a, n, 1), fwt(b, n, 1);
  for (int i = 0; i < n; i++) a[i] *= b[i];
  fwt(a, n, -1);
  for (int i = 0; i < n; i++) {
    long long k = 2 * __builtin_popcount(i);
    a[i] >>= k;
    printf("%lld", a[i] & 3);
  }
  return 0;
}
