#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9 + 10;
int n;
int xL, xR, yL, yR, zL, zR;
vector<pair<int, int> > pt;
bool check(int mid) {
  xL = -inf, xR = inf, yL = -inf, yR = inf, zL = -inf, zR = inf;
  for (pair<int, int> p : pt) {
    xL = max(xL, p.first - mid);
    xR = min(xR, p.first + mid);
    yL = max(yL, p.second - mid);
    yR = min(yR, p.second + mid);
    zL = max(zL, p.first - p.second - mid);
    zR = min(zR, p.first - p.second + mid);
  }
  if (xL > xR || yL > yR || zL > zR) return false;
  yL = max(yL, xL - zR);
  yR = min(yR, xR - zL);
  if (yL > yR) return false;
  return true;
}
int main() {
  std::ios::sync_with_stdio(false);
  cin >> n;
  for (int i = 1; i <= n; i++) {
    string s;
    cin >> s;
    int x = 0, y = 0;
    for (char c : s) {
      if (c == 'B')
        x++;
      else
        y++;
    }
    pt.emplace_back(x, y);
  }
  int l = 0, r = inf;
  while (r > l) {
    int mid = (l + r) >> 1;
    if (check(mid))
      r = mid;
    else
      l = mid + 1;
  }
  check(r);
  int ansx, ansy;
  for (int x = max(0, xL); x <= xR; x++) {
    int curyL = max(yR, x - zR);
    int curyR = min(yR, x - zL);
    if (curyL > curyR) continue;
    if (x > 0 || curyR > 0) {
      ansx = x;
      ansy = curyR;
      break;
    }
  }
  cout << r << "\n";
  while (ansx--) cout << "B";
  while (ansy--) cout << "N";
  cout << "\n";
  return 0;
}
