#include <bits/stdc++.h>
using namespace std;
const int M = 21, N = (1 << 21) + 1;
int n, m;
using ll = long long;
char s[N], t[N];
ll a[N], b[N], c[N];
void FWT(ll f[], int fl) {
  for (int l = 1; l < n; l <<= 1)
    for (int s = 0; s < n; s += l * 2)
      for (int i = 0; i < l; i++) f[i + s + l] += fl * f[i + s];
}
int main() {
  ios::sync_with_stdio(false);
  cin >> m >> s >> t;
  n = 1 << m;
  for (int i = 0; i < n; i++)
    a[i] = (s[i] & 15ll) << (__builtin_popcount(i) << 1);
  FWT(a, 1);
  for (int i = 0; i < n; i++)
    b[i] = (t[i] & 15ll) << (__builtin_popcount(i) << 1);
  FWT(b, 1);
  for (int i = 0; i < n; i++) c[i] = a[i] * b[i];
  FWT(c, -1);
  for (int i = 0; i < n; i++)
    putchar(((c[i] >> (__builtin_popcount(i) << 1)) & 3) + 48);
  return 0;
}
