#include <bits/stdc++.h>
using namespace std;
long long a[(1 << 21) + 5], b[(1 << 21) + 5], c[(1 << 21) + 5], fac[44];
int U;
void fwt(long long f[], int v) {
  for (int i = 1; i <= U; i <<= 1)
    for (int j = 0; j <= U; j += i << 1)
      for (int k = j; k < i + j; k++) f[i + k] += f[k] * v;
}
int cnt[(1 << 21) + 5];
char s[(1 << 21) + 5];
int main() {
  int n;
  cin >> n;
  U = (1 << n) - 1;
  for (int i = 1; i <= U; i++) cnt[i] = cnt[i >> 1] + (i & 1);
  fac[0] = 1;
  for (int i = 1; i <= n; i++) fac[i] = fac[i - 1] * 4;
  scanf("%s", s);
  for (int i = 0; i <= U; i++) a[i] = s[i] - '0', a[i] = a[i] * fac[cnt[i]];
  fwt(a, 1);
  scanf("%s", s);
  for (int i = 0; i <= U; i++) b[i] = s[i] - '0', b[i] = b[i] * fac[cnt[i]];
  fwt(b, 1);
  for (int i = 0; i <= U; i++) c[i] = a[i] * b[i];
  fwt(c, -1);
  for (int i = 0; i <= U; i++) printf("%lld", c[i] / fac[cnt[i]] & 3);
  return 0;
}
