#include <bits/stdc++.h>
using namespace std;
namespace thecold {
const int Max_n = (1 << 21) + 5;
int n, cnt[Max_n];
long long a[Max_n], b[Max_n];
char c[Max_n];
inline void FWT(long long *w) {
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < 1 << n; ++j)
      if (j & (1 << i)) w[j] += w[j ^ (1 << i)];
}
inline void IFWT(long long *w) {
  for (int i = n - 1; i >= 0; --i)
    for (int j = (1 << n) - 1; j >= 0; --j)
      if (j & (1 << i)) w[j] -= w[j ^ (1 << i)];
}
inline void main() {
  scanf("%d", &n);
  for (int i = 1; i < 1 << n; ++i) cnt[i] = cnt[i >> 1] + (i & 1);
  scanf("%s", c);
  for (int i = 0; i < 1 << n; ++i) a[i] = (1ll << (cnt[i] << 1)) * (c[i] - '0');
  scanf("%s", c);
  for (int i = 0; i < 1 << n; ++i) b[i] = (1ll << (cnt[i] << 1)) * (c[i] - '0');
  FWT(a), FWT(b);
  for (int i = 0; i < 1 << n; ++i) a[i] *= b[i];
  IFWT(a);
  for (int i = 0; i < 1 << n; ++i)
    printf("%lld", (a[i] / (1ll << (cnt[i] << 1))) & 3);
}
}  // namespace thecold
int main() {
  thecold::main();
  return 0;
}
