#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int f = 1, x = 0;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
inline long long readll() {
  long long f = 1, x = 0;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
char s1[(1 << 21) + 5], s2[(1 << 21) + 5];
long long a[1 << 21], b[1 << 21];
void fwt_or(long long a[], int n, long long op) {
  for (int i = 1; i < n; i <<= 1) {
    for (int j = 0; j < n; j += (i << 1)) {
      for (int k = j; k < i + j; ++k) {
        a[k + i] += a[k] * op;
      }
    }
  }
}
long long pow_(long long x, int k) {
  long long res = 1;
  while (k--) res *= x;
  return res;
}
int main() {
  int n;
  scanf("%d%s%s", &n, s1, s2);
  n = (1 << n);
  for (int i = 0; i < n; ++i)
    a[i] = (((long long)s1[i] & 15LL) << (__builtin_popcount(i) << 1));
  fwt_or(a, n, 1);
  for (int i = 0; i < n; ++i)
    b[i] = (((long long)s2[i] & 15LL) << (__builtin_popcount(i) << 1));
  fwt_or(b, n, 1);
  for (int i = 0; i < n; ++i) a[i] = a[i] * b[i];
  fwt_or(a, n, -1);
  for (int i = 0; i < n; ++i)
    cout << ((a[i] >> (__builtin_popcount(i) << 1)) & 3);
  cout << endl;
  return 0;
}
