#include <bits/stdc++.h>
using namespace std;
const int MAX = (1 << 21) + 5;
int n;
char s[MAX];
long long a[MAX], b[MAX], Pow[23], Count[MAX];
void FMT_or(long long *f, long long op) {
  for (int i = 1; i < (1 << n); i <<= 1) {
    for (int j = 0; j < (1 << n); j++) {
      if (!(j & i)) {
        f[j | i] = f[j | i] + f[j] * op;
      }
    }
  }
}
int main() {
  scanf("%d", &n);
  Pow[0] = 1;
  for (int i = 1; i <= n + 1; i++) Pow[i] = Pow[i - 1] * 4;
  for (int i = 1; i < (1 << n); i++) Count[i] = Count[i >> 1] + (i & 1);
  scanf("%s", s);
  for (int i = 0; i < (1 << n); i++) a[i] = 1ll * (s[i] - '0') * Pow[Count[i]];
  scanf("%s", s);
  for (int i = 0; i < (1 << n); i++) b[i] = 1ll * (s[i] - '0') * Pow[Count[i]];
  FMT_or(a, 1);
  FMT_or(b, 1);
  for (int i = 0; i < (1 << n); i++) a[i] = a[i] * b[i];
  FMT_or(a, -1);
  for (int i = 0; i < (1 << n); i++) printf("%lld", (a[i] / Pow[Count[i]]) & 3);
  return 0;
}
