#include <bits/stdc++.h>
using namespace std;
const int NN = 1 << 21 | 5;
unsigned int mod, to[256][256], up[256][256];
int m, bit[NN];
char s[NN];
unsigned int f[NN][2], g[NN][2], h[NN][2];
void add(unsigned int *a, unsigned int *b) {
  a[1] ^= b[1] ^ (a[0] & b[0]);
  a[0] ^= b[0];
}
void sub(unsigned int *a, unsigned int *b) {
  unsigned int c[2];
  c[0] = ~b[0] & mod;
  c[1] = ~b[1] & mod;
  add(a, c);
  c[0] = mod;
  c[1] = 0;
  add(a, c);
}
void mul(unsigned int *a, unsigned int *b, unsigned int *c) {
  for (int i = 0; i < 3; i++)
    for (int j = 0; i + j < 3; j++) {
      unsigned int x1 = (a[1] >> (i << 3)) & 255, x0 = (a[0] >> (i << 3)) & 255;
      unsigned int y1 = (b[1] >> (j << 3)) & 255, y0 = (b[0] >> (j << 3)) & 255;
      unsigned int z[2] = {to[x0][y0], to[x1][y0] ^ to[x0][y1] ^ up[x0][y0]};
      z[0] <<= i + j << 3;
      z[1] <<= i + j << 3;
      add(c, z);
    }
  c[0] &= mod;
  c[1] &= mod;
}
void fwt(unsigned int a[][2]) {
  for (int d = 1; d < m; d <<= 1)
    for (int n = d << 1, i = 0; i < m; i += n)
      for (int j = 0; j < d; j++) add(a[i | j | d], a[i | j]);
}
void ifwt(unsigned int a[][2]) {
  for (int d = 1; d < m; d <<= 1)
    for (int n = d << 1, i = 0; i < m; i += n)
      for (int j = 0; j < d; j++) sub(a[i | j | d], a[i | j]);
}
int main() {
  int n;
  cin >> n;
  m = 1 << n;
  mod = 2 * m - 1;
  for (int i = 0; i < 256; i++)
    for (int j = 0; j < 256; j++) {
      for (int k = 0; k < 16; k++) {
        int c = 0;
        for (int r = 0; r <= k; r++)
          c = (c + (i >> r & 1) * (j >> (k - r) & 1));
        if (c & 1) to[i][j] |= 1 << k;
        if (c & 2) up[i][j] |= 1 << k;
      }
    }
  for (int i = 1; i < m; i++) bit[i] = bit[i >> 1] + (i & 1);
  scanf("%s", s);
  for (int i = 0; i < m; i++) {
    int c = s[i] - '0';
    if (c & 1) f[i][0] |= 1 << bit[i];
    if (c & 2) f[i][1] |= 1 << bit[i];
  }
  scanf("%s", s);
  for (int i = 0; i < m; i++) {
    int c = s[i] - '0';
    if (c & 1) g[i][0] |= 1 << bit[i];
    if (c & 2) g[i][1] |= 1 << 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++)
    putchar('0' + (h[i][0] >> bit[i] & 1) + (h[i][1] >> bit[i] & 1) * 2);
  puts("");
  return 0;
}
