#include <bits/stdc++.h>
using namespace std;
template <typename T>
bool GetMin(T &a, T b) {
  return ((a <= b) ? false : (a = b, true));
}
template <typename T>
bool GetMax(T &a, T b) {
  return ((a >= b) ? false : (a = b, true));
}
const int N = 21;
const int M = (1 << N) + 10;
int n, S, cnt[M];
long long A[M], B[M], C[M];
int main() {
  scanf("%d", &n);
  S = (1 << n) - 1;
  for (int i = 1; i <= S; ++i) cnt[i] = cnt[i >> 1] + (i & 1);
  static char s[M];
  scanf("%s", s);
  for (int i = 0; i <= S; ++i) A[i] = (long long)(s[i] - '0') << (cnt[i] << 1);
  scanf("%s", s);
  for (int i = 0; i <= S; ++i) B[i] = (long long)(s[i] - '0') << (cnt[i] << 1);
  for (int i = 0; i < n; ++i)
    for (int j = 0; j <= S; ++j)
      if ((j >> i) & 1) {
        A[j] += A[j ^ (1 << i)];
        B[j] += B[j ^ (1 << i)];
      }
  for (int i = 0; i <= S; ++i) C[i] = A[i] * B[i];
  for (int i = 0; i < n; ++i)
    for (int j = 0; j <= S; ++j)
      if ((j >> i) & 1) C[j] -= C[j ^ (1 << i)];
  for (int i = 0; i <= S; ++i) putchar('0' + ((C[i] >> (cnt[i] << 1)) & 3));
  return 0;
}
