#include <bits/stdc++.h>
using namespace std;
const int N = (1 << 21) + 500;
unsigned long long a[N], b[N], c[N];
int cnt[N];
int n, m;
char s1[N], s2[N];
void FWT(unsigned long long* a, int op) {
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++)
      if (!(j & (1 << i))) a[j | (1 << i)] += a[j] * op;
}
int main() {
  scanf("%d%s%s", &n, s1, s2);
  m = 1 << n;
  for (int i = 1; i < m; i++) cnt[i] = cnt[i >> 1] + (i & 1);
  for (int i = 0; i < m; i++) a[i] = (s1[i] & 15ll) << (cnt[i] * 2);
  FWT(a, 1);
  for (int i = 0; i < m; i++) b[i] = (s2[i] & 15ll) << (cnt[i] * 2);
  FWT(b, 1);
  for (int i = 0; i < m; i++) c[i] = a[i] * b[i];
  FWT(c, -1);
  for (int i = 0; i < m; i++) putchar((c[i] >> (cnt[i] * 2)) % 4 + '0');
  return puts(""), 0;
}
