#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
constexpr ll inf = 0x3FFFFFFF;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  ll n;
  cin >> n;
  vector<pair<ll, ll>> pos(n);
  for (ll i = 0; i < n; i++) {
    string s;
    cin >> s;
    for (char c : s) {
      if (c == 'N')
        pos[i].first++;
      else
        pos[i].second++;
    }
  }
  ll xres, yres;
  auto ok = [&](ll x) {
    ll l = -inf;
    ll r = inf;
    ll dl = -inf;
    ll dr = inf;
    ll u = inf;
    ll d = -inf;
    for (auto e : pos) {
      l = max(l, e.first - x);
      r = min(r, e.first + x);
      dl = max(dl, e.first - e.second - x);
      dr = min(dr, e.first - e.second + x);
      u = min(u, e.second + x);
      d = max(d, e.second - x);
    }
    if (l > r) return false;
    if (d > u) return false;
    if (dl > dr) return false;
    if (r - d < dl) return false;
    if (l - u > dr) return false;
    if (r - u < dl) {
      xres = r;
      yres = r - dl;
    } else if (r - u > dr) {
      yres = u;
      xres = dr + u;
    } else {
      xres = r;
      yres = u;
    }
    return true;
  };
  ll l = -1;
  ll r = inf;
  while (l + 1 < r) {
    ll m = (l + r) / 2;
    if (ok(m)) {
      r = m;
    } else {
      l = m;
    }
  }
  cout << r << endl;
  ok(r);
  cout << string(xres, 'N') << string(yres, 'B') << endl;
}
