#include <bits/stdc++.h>
using namespace std;
inline void open(const char *s) {}
inline int rd() {
  static int x, f;
  x = 0;
  f = 1;
  char ch = getchar();
  for (; ch < '0' || ch > '9'; ch = getchar())
    if (ch == '-') f = -1;
  for (; ch >= '0' && ch <= '9'; ch = getchar()) x = x * 10 + ch - '0';
  return f > 0 ? x : -x;
}
const int N = (1 << 21) + 10, len = 1 << 21;
int n;
char s[N];
long long a[N], b[N];
inline void fwt(long long *a, int f) {
  for (int i = 2; i <= len; i <<= 1)
    for (int j = 0; j < len; j += i)
      for (int k = 0; k <= (i >> 1) - 1; k++)
        a[j + k + (i >> 1)] += f * a[j + k];
}
int main() {
  n = rd();
  scanf("%s", s);
  for (int i = 0; i <= (1 << n) - 1; i++)
    a[i] = (1ll * (s[i] - 48)) << (__builtin_popcount(i) << 1);
  fwt(a, 1);
  scanf("%s", s);
  for (int i = 0; i <= (1 << n) - 1; i++)
    b[i] = (1ll * (s[i] - 48)) << (__builtin_popcount(i) << 1);
  fwt(b, 1);
  for (int i = 0; i <= len - 1; i++) a[i] *= b[i];
  fwt(a, -1);
  for (int i = 0; i <= (1 << n) - 1; i++)
    a[i] = (a[i] >> (__builtin_popcount(i) << 1)) & 3;
  for (int i = 0; i <= (1 << n) - 1; i++) putchar(a[i] + 48);
  return 0;
}
