#include <bits/stdc++.h>
using namespace std;
int n, x[300005], y[300005];
char s[500005];
int ansb, ansn;
bool check(int mid, int ty) {
  int xl = 0, xr = 3000005, yl = 0, yr = 3000005, dl = -3000005, dr = 3000005;
  for (int i = 1; i <= n; i++) {
    xl = max(xl, x[i] - mid);
    xr = min(xr, x[i] + mid);
    yl = max(yl, y[i] - mid);
    yr = min(yr, y[i] + mid);
    dl = max(dl, x[i] - y[i] - mid);
    dr = min(dr, x[i] - y[i] + mid);
  }
  if (xl > xr || yl > yr || dl > dr) return 0;
  yl = max(yl, xl - dr);
  yr = min(yr, xr - dl);
  if (yl > yr) return 0;
  if (ty) {
    for (int x = xl; x <= xr; x++) {
      int ryl = max(yl, x - dr), ryr = min(yr, x - dl);
      if (ryl <= ryr && (x > 0 || ryr > 0)) {
        ansb = x, ansn = (x == 0) ? ryr : ryl;
        break;
      }
    }
  }
  return 1;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%s", s + 1);
    int len = strlen(s + 1);
    for (int j = 1; j <= len; j++)
      if (s[j] == 'B')
        x[i]++;
      else
        y[i]++;
  }
  int l = 0, r = 2e6;
  while (l <= r) {
    int mid = (l + r) >> 1;
    if (check(mid, 0))
      r = mid - 1;
    else
      l = mid + 1;
  }
  printf("%d\n", ++r);
  check(r, 1);
  for (int i = 1; i <= ansb; i++) putchar('B');
  for (int i = 1; i <= ansn; i++) putchar('N');
  putchar(10);
}
