#include <bits/stdc++.h>
using namespace std;
char a[2200005], b[2200005];
long long A[2200005], B[2200005], n;
void fwt(long long a[], long long tp) {
  for (long long i = 1; i < 1 << n; i <<= 1) {
    for (long long t = 0; t < 1 << n; t++) {
      if (i & t) a[t] += tp * a[t - i];
    }
  }
}
int main() {
  scanf("%lld%s%s", &n, a, b);
  for (long long i = 0; i < 1 << n; i++)
    A[i] = (a[i] & 15ll) << (__builtin_popcount(i) << 1);
  fwt(A, 1);
  for (long long i = 0; i < 1 << n; i++)
    B[i] = (b[i] & 15ll) << (__builtin_popcount(i) << 1);
  fwt(B, 1);
  for (long long i = 0; i < 1 << n; i++) A[i] = A[i] * B[i];
  fwt(A, -1);
  for (long long i = 0; i < 1 << n; i++)
    printf("%lld", (A[i] >> (__builtin_popcount(i) << 1)) & 3);
}
