#include <bits/stdc++.h>
using namespace std;
const int N = 21;
const int M = 1 << N;
char A[M + 10], B[M + 10];
int cnt[M];
void init(int lim) {
  for (int i = 1; i < lim; i++) cnt[i] = cnt[i >> 1] + (i & 1);
  return;
}
void FWT(vector<unsigned long long> &a, int t) {
  int lim = a.size();
  for (int i = 2; i <= lim; i *= 2) {
    for (int j = 0; j < lim; j += i) {
      for (int k = 0; k < (i >> 1); k++) {
        a[j + k + (i >> 1)] += a[j + k] * t;
      }
    }
  }
  return;
}
int main() {
  int n;
  scanf("%d", &n);
  scanf("%s", A);
  scanf("%s", B);
  int lim = 1 << n;
  init(lim);
  vector<unsigned long long> a(lim), b(lim);
  for (int i = 0; i < lim; i++) {
    a[i] |= (1ull << (cnt[i] * 2)) * (A[i] - '0');
    b[i] |= (1ull << (cnt[i] * 2)) * (B[i] - '0');
  }
  FWT(a, 1), FWT(b, 1);
  for (int i = 0; i < lim; i++) a[i] = a[i] * b[i];
  FWT(a, -1);
  for (int i = 0; i < lim; i++) printf("%llu", (a[i] >> (2 * cnt[i])) & 3);
  printf("\n");
  return 0;
}
