#include <bits/stdc++.h>
using namespace std;
int x[(500050)], y[(500050)], n, x_, y_;
char s[(500050)];
int check(int k) {
  int xl = 0, xr = (1e9 + 7), yl = 0, yr = (1e9 + 7), xyl = -(1e9 + 7),
      xyr = (1e9 + 7);
  for (int i = 1; i <= n; i++) {
    xl = max(xl, x[i] - k);
    xr = min(xr, x[i] + k);
    yl = max(yl, y[i] - k);
    yr = min(yr, y[i] + k);
    xyl = max(xyl, x[i] - y[i] - k);
    xyr = min(xyr, x[i] - y[i] + k);
  }
  int l = max(xl - yr, xyl), r = min(xr - yl, xyr);
  if (xl > xr || yl > yr || l > r) {
    return 0;
  }
  if (-r >= yr - xr) {
    y_ = yr, x_ = yr + r;
  } else {
    x_ = xr, y_ = xr - r;
  }
  return 1;
}
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    scanf("%s", s);
    for (int j = 0; s[j]; j++) {
      if (s[j] == 'B')
        x[i]++;
      else
        y[i]++;
    }
  }
  int l = 0, r = 1000000, ans = -1;
  while (l <= r) {
    int m = (l + r) >> 1;
    if (check(m)) {
      ans = m;
      r = m - 1;
    } else {
      l = m + 1;
    }
  }
  check(ans);
  if (!x_ && !y_) {
    ans++;
    x_++;
  }
  printf("%d\n", ans);
  while (x_) {
    printf("B");
    x_--;
  }
  while (y_) {
    printf("N");
    y_--;
  }
  printf("\n");
  return 0;
}
