#include <bits/stdc++.h>
using namespace std;
inline int readint() {
  int x = 0;
  bool f = 0;
  char c = getchar();
  while (!isdigit(c) && c != '-') c = getchar();
  if (c == '-') {
    f = 1;
    c = getchar();
  }
  while (isdigit(c)) {
    x = x * 10 + c - '0';
    c = getchar();
  }
  return f ? -x : x;
}
inline char readchar() {
  char c = getchar();
  while (isspace(c)) c = getchar();
  return c;
}
const int maxn = (1 << 21) + 5;
int n, cnt[maxn];
long long a[maxn], b[maxn];
void FWT(long long* f, int n, bool flag) {
  for (int i = 1; i < n; i *= 2)
    for (int j = 0; j < n; j += i * 2)
      for (int k = j; k < j + i; k++) f[k + i] += flag ? f[k] : -f[k];
}
int main() {
  n = 1 << readint();
  for (int i = 1; i < n; i++) cnt[i] = cnt[i ^ (i & -i)] + 1;
  for (int i = 0; i < n; i++) a[i] = (1ll * (readchar() - '0')) << 2 * cnt[i];
  for (int i = 0; i < n; i++) b[i] = (1ll * (readchar() - '0')) << 2 * cnt[i];
  FWT(a, n, 1);
  FWT(b, n, 1);
  for (int i = 0; i < n; i++) a[i] *= b[i];
  FWT(a, n, 0);
  for (int i = 0; i < n; i++) printf("%d", (int)(a[i] >> 2 * cnt[i] & 3));
  printf("\n");
  return 0;
}
