#include <bits/stdc++.h>
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
inline long long read() {
  register long long x = 0, f = 1;
  register char c = getchar();
  for (; !isdigit(c); c = getchar())
    if (c == '-') f = -1;
  for (; isdigit(c); c = getchar()) x = (x << 1) + (x << 3) + (c ^ 48);
  return x * f;
}
void write(long long x) {
  if (x < 0) x = -x, putchar('-');
  if (x >= 10) write(x / 10);
  putchar(x % 10 + '0');
}
void writeln(long long x) {
  write(x);
  puts("");
}
const long long N = 1 << 21 | 3;
long long n, bit[N];
long long a[N], b[N];
char A[N], B[N];
signed main() {
  n = read();
  scanf("%s%s", A, B);
  for (long long i = 0; i < (1 << n); i++) {
    if (i) bit[i] = bit[i >> 1] + (i & 1);
    a[i] = A[i] - '0';
    b[i] = B[i] - '0';
    a[i] <<= 2 * bit[i];
    b[i] <<= 2 * bit[i];
  }
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < (1 << n); j++)
      if (j >> i & 1) {
        a[j] += a[j ^ (1 << i)];
        b[j] += b[j ^ (1 << i)];
      }
  }
  for (long long i = 0; i < (1 << n); i++) a[i] *= b[i];
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < (1 << n); j++)
      if (j >> i & 1) a[j] -= a[j ^ (1 << i)];
  }
  for (long long i = 0; i < (1 << n); i++) {
    assert((a[i] >> bit[i] >> bit[i] << bit[i] << bit[i]) == a[i]);
    putchar((a[i] >> bit[i] >> bit[i] & 3) + '0');
  }
}
