#include <bits/stdc++.h>
#pragma GCC optimize(2)
#pragma G++ optimize(2)
using namespace std;
char nc() { return getchar(); }
int read() {
  int x = 0, y = 1;
  char c = nc();
  while (!isdigit(c)) {
    if (c == '-') y = -1;
    c = nc();
  }
  while (isdigit(c)) {
    x = (x << 1) + (x << 3) + (c ^ 48);
    c = nc();
  }
  return x * y;
}
int n, num[2100005];
long long a[2100005], b[2100005];
void fmt_or(long long a[], int n, int flag) {
  for (int i = 1; i < 1 << n; i <<= 1)
    for (int j = 0; j < 1 << n; j++)
      if (i & j) a[j] += flag * a[j - i];
}
int main() {
  n = read();
  num[0] = 0;
  for (int i = 1; i < 1 << n; i++) num[i] = num[i >> 1] + (i & 1);
  char c = nc();
  while (!isdigit(c)) c = nc();
  int i = 0;
  while (isdigit(c)) a[i] = ((1ll * (c ^ 48)) << (num[i] << 1)), i++, c = nc();
  c = nc();
  while (!isdigit(c)) c = nc();
  i = 0;
  while (isdigit(c)) b[i] = ((1ll * (c ^ 48)) << (num[i] << 1)), i++, c = nc();
  fmt_or(a, n, 1);
  fmt_or(b, n, 1);
  for (int i = 0; i < 1 << n; i++) a[i] = a[i] * b[i];
  fmt_or(a, n, -1);
  for (int i = 0; i < 1 << n; i++) printf("%lld", (a[i] >> (num[i] << 1)) & 3);
  return 0;
}
