#include <bits/stdc++.h>
using namespace std;
const int N = 1 << 21 | 1;
int n;
long long a[N], b[N];
char s[N];
void fwt(long long a[], int opt) {
  for (int i = 0; i < n; i++)
    for (int j = 0; j < 1 << n; j++)
      if (j & (1 << i)) a[j] += a[j ^ (1 << i)] * opt;
}
int main() {
  scanf("%d", &n);
  scanf("%s", s);
  for (int i = 0; i < 1 << n; i++)
    a[i] = (1ll << (__builtin_popcount(i) << 1)) * (s[i] - '0');
  scanf("%s", s);
  for (int i = 0; i < 1 << n; i++)
    b[i] = (1ll << (__builtin_popcount(i) << 1)) * (s[i] - '0');
  fwt(a, 1);
  fwt(b, 1);
  for (int i = 0; i < 1 << n; i++) a[i] *= b[i];
  fwt(a, -1);
  for (int i = 0; i < 1 << n; i++)
    printf("%d", (int)((a[i] >> (__builtin_popcount(i) << 1)) & 3));
}
