#include <bits/stdc++.h>
using namespace std;
inline int read() {
  char c = getchar();
  int x = 0;
  bool f = 0;
  for (; !isdigit(c); c = getchar()) f ^= !(c ^ 45);
  for (; isdigit(c); c = getchar()) x = (x << 1) + (x << 3) + (c ^ 48);
  if (f) x = -x;
  return x;
}
int x[300005], y[300005], n;
int resx, resy, xmin, xmax, ymin, ymax, bmin, bmax;
bool check(int l) {
  xmin = ymin = bmin = -0x3f3f3f3f;
  xmax = ymax = bmax = 0x3f3f3f3f;
  for (register int i = (1); i <= (n); ++i) {
    xmin = max(xmin, x[i] - l);
    ymin = max(ymin, y[i] - l);
    bmin = max(bmin, y[i] - x[i] - l);
    xmax = min(xmax, x[i] + l);
    ymax = min(ymax, y[i] + l);
    bmax = min(bmax, y[i] - x[i] + l);
  }
  xmin = max(xmin, 0);
  ymin = max(ymin, 0);
  if (xmin > xmax || ymin > ymax || bmin > bmax) return 0;
  resx = min(xmax, ymax - bmin);
  resy = min(ymax, resx + bmax);
  if (resx < xmin || resy < ymin) return 0;
  return 1;
}
char s[300005 << 1];
signed main() {
  n = read();
  for (register int i = (1); i <= (n); ++i) {
    cin >> s;
    int l = strlen(s);
    for (register int j = (1); j <= (l); ++j)
      if (s[j - 1] == 'B')
        x[i]++;
      else
        y[i]++;
  }
  int l = 0, r = 0x3f3f3f3f, res = 0x3f3f3f3f;
  while (l <= r) {
    int mid = l + r >> 1;
    if (check(mid))
      res = mid, r = mid - 1;
    else
      l = mid + 1;
  }
  cout << res << endl;
  check(res);
  for (register int i = (1); i <= (resx); ++i) cout << "B";
  for (register int i = (1); i <= (resy); ++i) cout << "N";
  return 0;
}
