#include <bits/stdc++.h>
using namespace std;
const int maxn = 22, maxm = (1 << 21) + 5;
int n, plc[maxm];
unsigned long long a[maxm], b[maxm], c[maxn];
char s[maxm];
void FMT(unsigned long long *a, int sgn) {
  for (int i = 0; i < n; i++)
    for (int j = 0; j < (1 << n); j++)
      if (!(j & (1 << i))) a[j | (1 << i)] = a[j | (1 << i)] + sgn * a[j];
}
int main() {
  scanf("%d", &n);
  plc[0] = 0;
  for (int i = 1; i < (1 << n); i++) plc[i] = plc[i >> 1] + ((i & 1) << 1);
  scanf("%s", s);
  for (int i = 0; i < (1 << n); i++)
    a[i] = ((unsigned long long)(s[i] - '0') << plc[i]);
  scanf("%s", s);
  for (int i = 0; i < (1 << n); i++)
    b[i] |= ((unsigned long long)(s[i] - '0') << plc[i]);
  FMT(a, 1);
  FMT(b, 1);
  for (int i = 0; i < (1 << n); i++) c[i] = a[i] * b[i];
  FMT(c, -1);
  for (int i = 0; i < (1 << n); i++) printf("%lld", (c[i] >> plc[i]) % 4);
  puts("");
  return 0;
}
