#include <bits/stdc++.h>
using namespace std;
const long long maxn = 3e5 + 9;
pair<long long, long long> a[maxn];
long long n;
pair<bool, pair<long long, long long> > check(long long l, long long r,
                                              long long u, long long d,
                                              long long kek1, long long kek2) {
  if (r < l || u < d || kek1 < kek2 || kek2 > u - l || kek1 < d - r)
    return make_pair(0, make_pair(0, 0));
  if (kek1 > u - l) return make_pair(1, make_pair(l, u));
  if (kek1 >= u - r) return make_pair(1, make_pair(u - kek1, u));
  return make_pair(1, make_pair(r, r + kek1));
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  long long l, r, u, d, kek1, kek2;
  for (long long i = 0; i < n; i++) {
    string s;
    cin >> s;
    for (long long e = 0; e < (long long)s.size(); e++) {
      if (s[e] == 'N')
        a[i].first++;
      else
        a[i].second++;
    }
    if (!i) {
      l = a[i].first, r = a[i].first;
      u = a[i].second, d = a[i].second;
      kek1 = a[i].second - a[i].first;
      kek2 = a[i].second - a[i].first;
    } else {
      l = min(l, a[i].first);
      r = max(r, a[i].first);
      u = max(u, a[i].second);
      d = min(d, a[i].second);
      kek1 = max(kek1, a[i].second - a[i].first);
      kek2 = min(kek2, a[i].second - a[i].first);
    }
  }
  long long left = (max(r - l, max(u - d, kek1 - kek2)) + 1) / 2 - 1,
            right = 1e6;
  while (right - left > 1) {
    long long mid = (left + right) / 2;
    long long l1 = r - 2 * mid, r1 = l;
    long long d1 = u - 2 * mid, u1 = d;
    long long kek11 = kek2 + mid, kek21 = kek1 - mid;
    if (check(l1, r1, u1, d1, kek11, kek21).first)
      right = mid;
    else
      left = mid;
  }
  cout << right << "\n";
  long long mid = right;
  long long l1 = r - 2 * mid, r1 = l;
  long long d1 = u - 2 * mid, u1 = d;
  long long kek11 = kek2 + mid, kek21 = kek1 - mid;
  pair<long long, long long> cur = (check(l1, r1, u1, d1, kek11, kek21)).second;
  cur.first += mid;
  cur.second += mid;
  for (long long i = 0; i < cur.first; i++) cout << 'N';
  for (long long i = 0; i < cur.second; i++) cout << 'B';
}
