#include <bits/stdc++.h>
using namespace std;
using PII = pair<long long, long long>;
const int maxn = 3e5 + 5;
const long long mod = 1e9 + 7;
const int inf = 1e9;
int cnt, len = 0, ansl, ansr, tol = inf;
int n[maxn], b[maxn];
string s[maxn];
inline int getans(int x, int y) {
  if (!x) y = max(y, 1);
  int ans = 0, now;
  for (int i = 1; i <= cnt; i++) {
    if (n[i] <= x && b[i] <= y)
      now = max(y - b[i], x - n[i]);
    else if (n[i] >= x && b[i] >= y)
      now = max(n[i] - x, b[i] - y);
    else if (n[i] <= x && b[i] >= y)
      now = x - n[i] + b[i] - y;
    else
      now = n[i] - x + y - b[i];
    ans = max(ans, now);
  }
  if (ans < tol) {
    tol = ans;
    ansl = x;
    ansr = y;
  }
  return ans;
}
inline int cal(int x) {
  int l = 0, r = len;
  while (l < r) {
    int m1 = (2 * l + r) / 3;
    int m2 = (2 * r + l + 2) / 3;
    if (getans(x, m1) < getans(x, m2))
      r = m2 - 1;
    else
      l = m1 + 1;
  }
  return getans(x, l);
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0), cout.tie(0);
  cin >> cnt;
  for (int i = 1; i <= cnt; i++) {
    cin >> s[i];
    for (auto v : s[i]) {
      if (v == 'N')
        n[i]++;
      else
        b[i]++;
    }
    len = max(len, (int)s[i].size());
  }
  int l = 0, r = len;
  while (l < r) {
    int m1 = (2 * l + r) / 3;
    int m2 = (2 * r + l + 2) / 3;
    if (cal(m1) < cal(m2))
      r = m2 - 1;
    else
      l = m1 + 1;
  }
  cal(l);
  cout << tol << '\n';
  for (int i = 1; i <= ansl; i++) cout << "N";
  for (int i = 1; i <= ansr; i++) cout << "B";
}
