#include <bits/stdc++.h>
using namespace std;
const int N = (1 << 21) + 10;
const long long mod = 1e9 + 7;
const long long mod2 = 998244353;
const long long inf = 8e18;
const int LOG = 22;
char A[N], B[N];
int n, P[N];
long long SA[N], SB[N];
int main() {
  scanf("%d%s%s", &n, A, B);
  for (int mask = 0; mask < 1 << n; mask++) {
    P[mask] = P[mask >> 1] + 2 * (mask & 1);
    SA[mask] = (1ll * (A[mask] - '0') << P[mask]);
    SB[mask] = (1ll * (B[mask] - '0') << P[mask]);
  }
  for (int T = 0; T < n; T++) {
    for (int mask = 0; mask < 1 << n; mask++) {
      if (mask >> T & 1) {
        SA[mask] += SA[mask ^ (1 << T)];
      }
    }
  }
  for (int T = 0; T < n; T++) {
    for (int mask = 0; mask < 1 << n; mask++) {
      if (mask >> T & 1) {
        SB[mask] += SB[mask ^ (1 << T)];
      }
    }
  }
  for (int mask = 0; mask < 1ll << n; mask++) {
    SA[mask] = SA[mask] * SB[mask];
  }
  for (int T = 0; T < n; T++) {
    for (int mask = 0; mask < 1 << n; mask++) {
      if (mask >> T & 1) {
        SA[mask] -= SA[mask ^ (1 << T)];
      }
    }
  }
  for (int mask = 0; mask < 1 << n; mask++) {
    long long cu = SA[mask] >> P[mask];
    printf("%lld", cu & 3ll);
  }
  return 0;
}
