#include <bits/stdc++.h>
using namespace std;
void fwt_or(long long *a, long long n, long long opt) {
  for (long long step = 1; step < n; step <<= 1) {
    for (long long i = 0; i < n; i += (step << 1)) {
      for (long long j = i; j < i + step; ++j) {
        a[j + step] += opt * a[j];
      }
    }
  }
}
long long n, a[(1 << 21) + 3], b[(1 << 21) + 3], bit[(1 << 21) + 3], po[22];
char sa[(1 << 21) + 3], sb[(1 << 21) + 3];
signed main() {
  scanf("%lld", &n);
  scanf("%s", sa);
  scanf("%s", sb);
  po[0] = 1;
  for (long long i = 1; i <= 21; ++i) po[i] = po[i - 1] * 4;
  for (long long i = 0; i < (1 << n); ++i) {
    bit[i] = bit[i >> 1] + (i & 1);
    a[i] = ((sa[i] & 15ll)) * po[bit[i]];
    b[i] = ((sb[i] & 15ll)) * po[bit[i]];
  }
  fwt_or(a, (1 << n), 1);
  fwt_or(b, (1 << n), 1);
  for (long long i = 0; i < (1 << n); ++i) a[i] = a[i] * b[i];
  fwt_or(a, (1 << n), -1);
  for (long long i = 0; i < (1 << n); ++i) {
    putchar(a[i] >> (bit[i] << 1) & 3 | 48);
  }
}
