#include <bits/stdc++.h>
using namespace std;
int const N = 500000;
char s[N + 1];
int an;
void up(int t) { an = max(an, t); }
int main() {
  int n, lx = -N, rx = N, ly = -N, ry = N, lxy = -N, rxy = +N;
  scanf("%d", &n);
  for (int i = 0; i < (int)(n); ++i) {
    scanf("%s", s);
    int j = 0, x = 0, y = 0;
    while (s[j])
      if (s[j++] == 'N')
        ++x;
      else
        ++y;
    lx = max(lx, x);
    rx = min(rx, x);
    ly = max(ly, y);
    ry = min(ry, y);
    lxy = max(lxy, x - y);
    rxy = min(rxy, x - y);
  }
  up(lx - rx + 1 >> 1);
  up(ly - ry + 1 >> 1);
  up(lxy - rxy + 1 >> 1);
  up((lx - ry - rxy + 2) / 3);
  up((lxy - rx + ly + 2) / 3);
  printf("%d\n", an);
  lx -= an;
  ly -= an;
  lxy -= an;
  rx += an;
  ry += an;
  rxy += an;
  int x, y;
  if (rx - lxy < ry) {
    x = rx;
    y = x - lxy;
  } else {
    y = ry;
    x = min(rx, ry + rxy);
  }
  for (int i = 0; i < (int)(x); ++i) printf("N");
  for (int i = 0; i < (int)(y); ++i) printf("B");
  printf("\n");
}
