#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false), cout.tie(0), cin.tie(0);
  int n;
  cin >> n;
  vector<int> x(n), y(n);
  for (int i = 0; i < n; ++i) {
    string t;
    cin >> t;
    for (char c : t)
      if (c == 'N')
        x[i]++;
      else
        y[i]++;
  }
  int X, Y;
  auto ok = [&](int mid) {
    int lt = x[0] - mid, rg = x[0] + mid, tp = y[0] + mid, bt = y[0] - mid,
        dl = x[0] - y[0] - mid, dr = x[0] - y[0] + mid;
    for (int i = 1; i < n; ++i) {
      lt = max(x[i] - mid, lt);
      rg = min(x[i] + mid, rg);
      bt = max(y[i] - mid, bt);
      tp = min(y[i] + mid, tp);
      dl = max(x[i] - y[i] - mid, dl);
      dr = min(x[i] - y[i] + mid, dr);
    }
    lt = max(0, lt);
    bt = max(0, bt);
    if (lt > rg || bt > tp || dl > dr) return false;
    if (lt - tp > dr || rg - bt < dl) return false;
    X = lt, Y = tp;
    int D = max(0, dl - (lt - tp));
    if (D <= rg - lt)
      X = lt + D;
    else
      X = rg, Y = tp - D + (rg - lt);
    return true;
  };
  int l = 0, r = 1000000;
  while (l < r) {
    int mid = (l + r) >> 1;
    if (ok(mid)) {
      r = mid;
    } else {
      l = mid + 1;
    }
  }
  ok(l);
  cout << l << "\n";
  cout << string(X, 'N') + string(Y, 'B') << '\n';
  return 0;
}
