#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  cin >> n;
  string s[n];
  int ax, ay, bx, by, x, y;
  ax = bx = x = INT_MAX;
  ay = by = y = INT_MIN;
  for (int i = 0; i < n; i++) {
    cin >> s[i];
    int bb = 0, nn = 0;
    for (char c : s[i]) {
      if (c == 'B')
        bb++;
      else
        nn++;
    }
    ax = min(ax, bb);
    ay = max(ay, bb);
    bx = min(bx, nn);
    by = max(by, nn);
    x = min(x, nn - bb);
    y = max(y, nn - bb);
  }
  int l = 0, r = 1000000, ans;
  auto check = [&](int mid) {
    if (2 * mid < y - x) return false;
    int p = ax + mid, q = bx + mid;
    p = min(p, q - y + mid);
    q = min(q, p + x + mid);
    if (p + mid >= ay && q + mid >= by) return true;
    return false;
  };
  while (r >= l) {
    int mid = (r + l) >> 1;
    if (check(mid)) {
      r = mid - 1;
      ans = mid;
    } else
      l = mid + 1;
  }
  int p = ax + ans, q = bx + ans;
  p = min(p, q - y + ans);
  q = min(q, p + x + ans);
  cout << ans << endl;
  for (int i = 0; i < p; i++) cout << 'B';
  for (int i = 0; i < q; i++) cout << 'N';
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int t = 1;
  while (t--) solve();
}
