#include <bits/stdc++.h>
using namespace std;
long long read() {
  long long a = 0, b = getchar(), c = 1;
  while (!isdigit(b)) c = b == '-' ? -1 : 1, b = getchar();
  while (isdigit(b)) a = a * 10 + b - '0', b = getchar();
  return a * c;
}
long long n, m, ma = 1e15, mb, nb = 1e15, c = -1e15, d = 1e15, an1, an2;
char s[500005];
bool check(long long i) {
  long long x = max(0ll, m - i), xx = ma + i, y = max(0ll, mb - i), yy = nb + i,
            ab = d + i, ac = c - i;
  if (x > xx or y > yy or ac > ab) return false;
  if (y - xx > ab or yy - x < ac) return false;
  if ((ab >= yy - xx) and (ac <= yy - xx))
    an2 = xx, an1 = yy;
  else if (ac >= yy - xx)
    an1 = yy, an2 = yy - ac;
  else
    an2 = xx, an1 = xx + ab;
  return true;
}
int main() {
  n = read();
  for (int i = 1; i <= n; i++) {
    scanf("%s", s);
    long long k = strlen(s), a = 0, b = 0;
    for (int j = 0; j < k; j++) {
      if (s[j] == 'N')
        a++;
      else
        b++;
    }
    ma = min(ma, a), m = max(a, m);
    nb = min(nb, b), mb = max(b, mb);
    c = max(c, b - a), d = min(d, b - a);
  }
  long long l = 0, r = 500005;
  while (l < r) {
    long long mid = (l + r) >> 1;
    if (check(mid))
      r = mid;
    else
      l = mid + 1;
  }
  check(l);
  printf("%lld\n", l);
  for (int i = 0; i < an1; i++) printf("B");
  for (int i = 0; i < an2; i++) printf("N");
  return 0;
}
