#include <bits/stdc++.h>
using namespace std;
int n, plc[(1 << 21) + 5];
unsigned long long a[(1 << 21) + 5], b[(1 << 21) + 5], c[(1 << 21) + 5];
char s[(1 << 21) + 5], t[(1 << 21) + 5];
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%s%s", &n, s, t);
  for (int i = 1; i < (1 << n); i++) plc[i] = plc[i >> 1] + ((i & 1) << 1);
  for (int i = 0; i < (1 << n); i++)
    a[i] = ((unsigned long long)(s[i] - '0') << plc[i]);
  for (int i = 0; i < (1 << n); i++)
    b[i] |= ((unsigned long long)(t[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);
}
