#include <bits/stdc++.h>
using namespace std;
int n;
long long a[(1 << 21) + 6], b[(1 << 21) + 6];
void FWT(long long* A, int len) {
  for (int mid = 2; mid <= len; mid <<= 1)
    for (int i = 0; i < len; i += mid)
      for (int j = i; j < i + (mid >> 1); ++j) A[j + (mid >> 1)] += A[j];
}
void IFWT(long long* A, int len) {
  for (int mid = 2; mid <= len; mid <<= 1)
    for (int i = 0; i < len; i += mid)
      for (int j = i; j < i + (mid >> 1); ++j) A[j + (mid >> 1)] -= A[j];
}
long long bit[(1 << 21) + 6];
void solve() {
  cin >> n;
  n = (1 << n);
  int pr;
  for (int i = (0), iend = (n - 1); i <= iend; ++i)
    bit[i] = (1ll << 2 * __builtin_popcount(i));
  for (int i = (0), iend = (n - 1); i <= iend; ++i)
    scanf("%1d", &pr), a[i] = pr * bit[i];
  for (int i = (0), iend = (n - 1); i <= iend; ++i)
    scanf("%1d", &pr), b[i] = pr * bit[i];
  FWT(a, n), FWT(b, n);
  for (int i = (0), iend = (n - 1); i <= iend; ++i) a[i] = a[i] * b[i];
  IFWT(a, n);
  for (int i = (0), iend = (n - 1); i <= iend; ++i)
    pr = (a[i] / bit[i]) & 3, printf("%d", pr);
}
signed main() { solve(); }
