#include <bits/stdc++.h>
using namespace std;
int n;
long long c[1 << 21];
int bitc[1 << 21];
long long a[1 << 21], b[1 << 21];
char s[1 << 21];
void FMT(void) {
  for (int i = 0; i < n; i++)
    for (int j = 0; j < (1 << n); j++)
      if (j >> i & 1) {
        a[j] += a[j ^ (1 << i)];
        b[j] += b[j ^ (1 << i)];
      }
}
void IFMT(long long *a) {
  for (int i = 0; i < n; i++)
    for (int j = 0; j < (1 << n); j++)
      if (j >> i & 1) a[j] -= a[j ^ (1 << i)];
}
int main(void) {
  scanf("%d", &n);
  for (int i = 1; i < (1 << n); i++) bitc[i] = bitc[i >> 1] + (i & 1);
  scanf("%s", s);
  for (int i = 0; i < (1 << n); i++)
    a[i] = (long long)(s[i] - 48) << (bitc[i] << 1);
  scanf("%s", s);
  for (int i = 0; i < (1 << n); i++)
    b[i] = (long long)(s[i] - 48) << (bitc[i] << 1);
  FMT();
  for (int i = 0; i < (1 << n); i++) c[i] = a[i] * b[i];
  IFMT(c);
  for (int i = 0; i < (1 << n); i++)
    putchar(48 + ((c[i] >> (bitc[i] << 1)) & 3));
  return 0;
}
