#include <bits/stdc++.h>
using namespace std;
const int N = 1 << 21;
long long a[N], b[N];
int n;
string s;
void FMT(long long *a, int len) {
  for (int i = 1; i < (1 << len); i <<= 1)
    for (int j = i; j < (1 << len); j = (j + 1) | i) a[j] += a[j ^ i];
}
void IFMT(long long *a, int len) {
  for (int i = 1; i < (1 << len); i <<= 1)
    for (int j = i; j < (1 << len); j = (j + 1) | i) a[j] -= a[j ^ i];
}
int main() {
  ios::sync_with_stdio(0);
  cin >> n >> s;
  for (int i = 0; i < (1 << n); ++i) {
    a[i] = (long long)(s[i] - '0') << (__builtin_popcount(i) << 1);
  }
  cin >> s;
  for (int i = 0; i < (1 << n); ++i) {
    b[i] = (long long)(s[i] - '0') << (__builtin_popcount(i) << 1);
  }
  FMT(a, n);
  FMT(b, n);
  for (int i = 0; i < (1 << n); ++i) a[i] *= b[i];
  IFMT(a, n);
  for (int i = 0; i < (1 << n); ++i)
    putchar('0' + ((a[i] >> (__builtin_popcount(i) << 1)) & 3));
}
