#include <bits/stdc++.h>
using namespace std;
const int MX = 3e5 + 10;
const int MX2 = 5e5;
const int INF = 1e9;
int n;
int a, b, rpa, rpb, cur;
int cnt[2][MX];
int f(int val1, int val2) {
  int ans = 0;
  for (int i = 0; i < n; i++) {
    ans = max(ans, max({0, cnt[0][i] - val1, cnt[1][i] - val2}) +
                       max({0, val1 - cnt[0][i], val2 - cnt[1][i]}));
  }
  return ans;
}
int ts2(int val, int l, int r) {
  while (r - l > 2) {
    int m1 = l + (r - l) / 3;
    int m2 = r - (r - l) / 3;
    if (f(val, m1) > f(val, m2)) {
      l = m1;
    } else {
      r = m2;
    }
  }
  int ans = f(val, l);
  b = l;
  for (int i = l + 1; i <= r; i++) {
    int aux = f(val, i);
    if (ans > aux) {
      ans = aux;
      b = i;
    }
  }
  return ans;
}
void ts(int l, int r, int xl, int xr) {
  while (r - l > 2) {
    int m1 = l + (r - l) / 3;
    int m2 = r - (r - l) / 3;
    if (ts2(m1, xl, xr) > ts2(m2, xl, xr)) {
      l = m1;
    } else {
      r = m2;
    }
  }
  int aux = ts2(l, xl, xr);
  if (cur > aux) {
    cur = aux;
    rpa = l;
    rpb = b;
  }
  for (int i = l + 1; i <= r; i++) {
    aux = ts2(i, xl, xr);
    if (cur > aux) {
      cur = aux;
      rpa = i;
      rpb = b;
    }
  }
  return;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cout.precision(10);
  cout << fixed;
  string s;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> s;
    for (int j = 0; j < s.size(); j++) cnt[(s[j] == 'B' ? 0 : 1)][i]++;
  }
  cur = INF;
  ts(1, MX2, 0, MX2);
  ts(0, 0, 1, MX2);
  cout << cur << "\n";
  for (int i = 0; i < rpa; i++) cout << "B";
  for (int i = 0; i < rpb; i++) cout << "N";
  cout << "\n";
  return 0;
}
