#include <bits/stdc++.h>
using namespace std;
void Freopen() {
  freopen(
      "title"
      ".in",
      "r", stdin);
  freopen(
      "title"
      ".out",
      "w", stdout);
}
int read() {
  int g = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || '9' < ch) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while ('0' <= ch && ch <= '9') {
    g = g * 10 + ch - '0';
    ch = getchar();
  }
  return g * f;
}
const int N = 22;
const int M = 1 << 21;
long long a[M], b[M], c[M];
int n, sta, size[M];
char s[M];
void fwt(long long *a, int n, int opt) {
  for (int i = 1; i < 1 << n; i <<= 1)
    for (int j = (0); j <= ((1 << n) - 1); j++)
      if (i & j) a[j] = a[j] + a[j - i] * opt;
}
signed main() {
  n = read();
  sta = (1 << n) - 1;
  for (int i = (0); i <= (sta); i++) size[i] = size[i >> 1] + (i & 1);
  scanf("%s", s);
  for (int i = (0); i <= (sta); i++)
    a[i] = 1ll * (s[i] - '0') << (size[i] << 1);
  scanf("%s", s);
  for (int i = (0); i <= (sta); i++)
    b[i] = 1ll * (s[i] - '0') << (size[i] << 1);
  fwt(a, n, 1), fwt(b, n, 1);
  for (int i = (0); i <= (sta); i++) c[i] = a[i] * b[i];
  fwt(c, n, -1);
  for (int i = (0); i <= (sta); i++) cout << ((c[i] >> (size[i] << 1)) & 3);
  return signed();
}
