#include <bits/stdc++.h>
using namespace std;
const int N = 5e5 + 5;
int n, x, y;
string s;
int l = 1e9, r = -1e9, u = -1e9, d = 1e9, bx = -1e9, bn = 1e9;
int check(int x, int y) {
  return max({x - l, r - x, u - y, y - d, bx - (y - x), (y - x) - bn});
}
int main() {
  ios::sync_with_stdio(false);
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> s;
    x = count(s.begin(), s.end(), 'N'), y = s.length() - x;
    l = min(l, x);
    r = max(r, x);
    d = min(d, y);
    u = max(u, y);
    bn = min(bn, y - x), bx = max(bx, y - x);
  }
  int ax = r, ay = u;
  for (int x = max(l, 1); x <= r; x++) {
    int y = (max(u, bx + x) + min(d, bn + x)) / 2;
    if (check(x, y) < check(ax, ay)) ax = x, ay = y;
  }
  cout << check(ax, ay) << "\n";
  cout << string(ax, 'N') + string(ay, 'B') << "\n";
  return 0;
}
