#include <bits/stdc++.h>
using namespace std;
int bits[2222222];
long long A[2222222], B[2222222], C[2222222];
char a[2222222], b[2222222];
int main() {
  int n, i, j;
  for (i = 0; i < 1 << 21; i++) bits[i] = bits[i / 2] + (i & 1);
  scanf("%d%s%s", &n, a, b);
  for (i = 0; i < 1 << n; i++)
    A[i] = (1ll << (2 * bits[i])) * (a[i] - '0'),
    B[i] = (1ll << (2 * bits[i])) * (b[i] - '0');
  for (i = 0; i < n; i++)
    for (j = 0; j < 1 << n; j++)
      A[j] += ((j >> i) & 1) * A[j ^ (1 << i)],
          B[j] += ((j >> i) & 1) * B[j ^ (1 << i)];
  for (i = 0; i < 1 << n; i++) C[i] = (A[i] * B[i]) & 17592186044415ll;
  for (i = 0; i < n; i++)
    for (j = 0; j < 1 << n; j++) C[j] -= ((j >> i) & 1) * C[j ^ (1 << i)];
  for (i = 0; i < 1 << n; i++)
    putchar(((C[i] >> (2 * bits[i])) % 4 + 4) % 4 + '0');
  return 0;
}
