#include <bits/stdc++.h>
using namespace std;
const int MAXN = (1LL << 21) + 10;
int N, T, len, Imakf, bits[MAXN];
long long a[MAXN], b[MAXN];
char tem[MAXN];
void fi(const char* tem) {
  if (!strlen(tem)) return;
  char A[50];
  const char B[4] = {'.', 'i', 'n', 0}, C[5] = {'.', 'o', 'u', 't', 0};
  sprintf(A, "%s%s", tem, B);
  freopen(A, "r", stdin);
  sprintf(A, "%s%s", tem, C);
  freopen(A, "w", stdout);
}
void fwt(long long* A, int type) {
  for (int mid = 1; mid < len; mid <<= 1) {
    for (int j = 0; j < len; j += (mid << 1)) {
      for (int k = 0; k < mid; k++) {
        A[j + k + mid] += type * A[j + k];
      }
    }
  }
}
int main() {
  fi("");
  scanf("%d", &N);
  len = 1LL << N, Imakf = len - 1;
  for (int i = 0; i < len; i++) bits[i] = bits[i >> 1] + (i & 1);
  scanf("%s", tem);
  for (int i = 0; i < len; i++)
    a[i] = (long long)(tem[i] - '0') << ((long long)bits[i] << 1);
  fwt(a, 1);
  scanf("%s", tem);
  for (int i = 0; i < len; i++)
    b[i] = (long long)(tem[i] - '0') << ((long long)bits[i] << 1);
  fwt(b, 1);
  for (int i = 0; i < len; i++) b[i] = (b[i] * a[i]);
  fwt(b, -1);
  for (int i = 0; i < len; i++)
    printf("%lld", ((long long)b[i] >> ((long long)bits[i] << 1)) & 3);
  return 0;
}
