#include <bits/stdc++.h>
using namespace std;
int n;
unsigned long long a[2100000], b[2100000];
void fwt(unsigned long long* a) {
  for (int j = 0; j < n; ++j)
    for (int i = 0; i < (1 << n); ++i)
      if (i & (1 << j)) a[i] += a[i ^ (1 << j)];
}
void ifwt(unsigned long long* a) {
  for (int j = 0; j < n; ++j)
    for (int i = 0; i < (1 << n); ++i)
      if (i & (1 << j)) a[i] -= a[i ^ (1 << j)];
}
char s[2100000];
int main() {
  scanf("%d", &n);
  scanf("%s", s);
  for (int i = 0; i < (1 << n); ++i)
    a[i] = s[i] - 48, a[i] <<= __builtin_popcount(i) * 2;
  scanf("%s", s);
  for (int i = 0; i < (1 << n); ++i)
    b[i] = s[i] - 48, b[i] <<= __builtin_popcount(i) * 2;
  fwt(a);
  fwt(b);
  for (int i = 0; i < (1 << n); ++i) a[i] *= b[i];
  ifwt(a);
  for (int i = 0; i < (1 << n); ++i)
    printf("%llu", (a[i] >> (__builtin_popcount(i) * 2)) & 3);
}
