#include <bits/stdc++.h>
using namespace std;
const int N = 1 << 21;
char s[N];
int n, S, sz[N];
unsigned long long f[N], g[N];
void fwt(unsigned long long *w) {
  for (int i = 1; i < S; i <<= 1)
    for (int j = 0; j < S; j += i << 1)
      for (int k = 0; k < i; ++k) w[j + k + i] += w[j + k];
  return;
}
void ufwt(unsigned long long *w) {
  for (int i = 1; i < S; i <<= 1)
    for (int j = 0; j < S; j += i << 1)
      for (int k = 0; k < i; ++k) w[j + k + i] -= w[j + k];
  return;
}
int main() {
  cin >> n, S = 1 << n;
  for (int i = 0; i < S; ++i) sz[i] = sz[i >> 1] + (i & 1);
  scanf("%s", s);
  for (int i = 0; i < S; ++i) f[i] = 1ll * (s[i] - '0') << (2 * sz[i]);
  scanf("%s", s);
  for (int i = 0; i < S; ++i) g[i] = 1ll * (s[i] - '0') << (2 * sz[i]);
  fwt(f), fwt(g);
  for (int i = 0; i < S; ++i) f[i] *= g[i];
  ufwt(f);
  for (int i = 0; i < S; ++i) putchar((f[i] >> (2 * sz[i]) & 3) + '0');
  return 0;
}
