#include <bits/stdc++.h>
using namespace std;
char Read() {
  char c = getchar();
  while (c < '0' || c > '3') c = getchar();
  return c;
}
int n;
unsigned long long a[1 << 21], b[1 << 21], f[1 << 21];
void dft(unsigned long long* a) {
  for (int i = 1; i < (1 << n); i <<= 1)
    for (int j = 0; j < (1 << n); j += (i << 1))
      for (int k = 0; k < i; ++k) a[j + i + k] = a[j + k] + (a[j + i + k] << 2);
}
void idft(unsigned long long* a) {
  for (int i = 1; i < (1 << n); i <<= 1)
    for (int j = 0; j < (1 << n); j += (i << 1))
      for (int k = 0; k < i; ++k) a[j + i + k] = (a[j + i + k] - a[j + k] >> 2);
}
int main() {
  cin >> n;
  for (int i = 0; i <= (1 << n) - 1; ++i) a[i] = Read() - '0';
  for (int i = 0; i <= (1 << n) - 1; ++i) b[i] = Read() - '0';
  dft(a);
  dft(b);
  for (int i = 0; i <= (1 << n) - 1; ++i) a[i] = a[i] * b[i];
  idft(a);
  for (int i = 0; i <= (1 << n) - 1; ++i) putchar('0' + (a[i] & 3));
  puts("");
}
