#include <bits/stdc++.h>
using namespace std;
const int NN = 1 << 21 | 5;
const long long T = 0x555555555555LL, S = (1LL << 50) - 1;
int m;
char s[NN], bit[NN];
long long f[NN], g[NN], h[NN];
inline void add(long long &x, const long long &y) {
  x ^= y ^ ((x & y & T) << 1);
}
inline void sub(long long &x, const long long &y) {
  add(x, ~y & S);
  add(x, T);
}
long long Y[4];
inline void mul(const long long &x, long long y, long long &z) {
  Y[3] = Y[2] = Y[1] = x;
  add(Y[2], x);
  add(Y[3], Y[2]);
  int t;
  while (y) {
    if (t = (y & 3)) add(z, Y[t]);
    (Y[1] <<= 2) &= S;
    (Y[2] <<= 2) &= S;
    (Y[3] <<= 2) &= S;
    y >>= 2;
  }
}
void fwt(long long a[]) {
  for (int d = 1; d < m; d <<= 1)
    for (int j = 0, t = d << 1; j < m; j += t)
      for (int i = 0; i < d; i++) add(a[i | j | d], a[i | j]);
}
void ifwt(long long a[]) {
  for (int d = 1; d < m; d <<= 1)
    for (int j = 0, t = d << 1; j < m; j += t)
      for (int i = 0; i < d; i++) sub(a[i | j | d], a[i | j]);
}
int main() {
  int n;
  cin >> n;
  m = 1 << n;
  for (int i = 1; i < m; i++) bit[i] = bit[i >> 1] + (i & 1) * 2;
  scanf("%s", s);
  for (int i = 0; i < m; i++) {
    long long c = s[i] - '0';
    f[i] = c << bit[i];
  }
  scanf("%s", s);
  for (int i = 0; i < m; i++) {
    long long c = s[i] - '0';
    g[i] = c << bit[i];
  }
  fwt(f);
  fwt(g);
  for (int i = 0; i < m; i++) mul(f[i], g[i], h[i]);
  ifwt(h);
  for (int i = 0; i < m; i++) s[i] = '0' + ((h[i] >> bit[i]) & 3);
  fwrite(s, m, 1, stdout);
  return 0;
}
