#include <bits/stdc++.h>
using namespace std;
char sa[(1 << 21) + 5], sb[(1 << 21) + 5];
unsigned long long a[(1 << 21) + 5], b[(1 << 21) + 5];
int cnt[(1 << 21) + 5];
int N;
void fwt(unsigned long long *a, int opt) {
  for (int i = 1; i < N; i <<= 1)
    for (int p = i << 1, j = 0; j < N; j += p)
      for (int k = 0; k <= i - 1; k++)
        if (opt == 1)
          a[i + j + k] = a[j + k] + a[i + j + k];
        else
          a[i + j + k] = a[i + j + k] - a[j + k];
}
int main() {
  int n;
  scanf("%d%s%s", &n, sa, sb);
  N = 1 << n;
  for (int i = 1; i <= N - 1; i++) cnt[i] = cnt[i >> 1] + (i & 1);
  for (int i = 0; i <= N - 1; i++)
    a[i] = (unsigned long long)(sa[i] - '0') << (cnt[i] * 2);
  for (int i = 0; i <= N - 1; i++)
    b[i] = (unsigned long long)(sb[i] - '0') << (cnt[i] * 2);
  fwt(a, 1);
  fwt(b, 1);
  for (int i = 0; i <= N - 1; i++) a[i] *= b[i];
  fwt(a, -1);
  for (int i = 0; i <= N - 1; i++)
    printf("%c", ((a[i] >> (cnt[i] * 2)) & 3) + '0');
  puts("");
  return 0;
}
