#include <bits/stdc++.h>
using namespace std;
const long long N = 3e5 + 6;
long long n;
pair<long long, long long> coor[N];
pair<long long, long long> ok(long long mid) {
  long long left = 0;
  long long right = INT_MAX;
  long long down = 0;
  long long up = INT_MAX;
  long long down_left = 1;
  long long up_right = INT_MAX;
  long long down_right = INT_MAX;
  long long up_left = INT_MIN;
  for (long long i = 1; i <= n; i++) {
    long long x = coor[i].first;
    long long y = coor[i].second;
    left = max(left, x - mid);
    right = min(right, x + mid);
    down = max(down, y - mid);
    up = min(up, y + mid);
    down_left = max(down_left, x + y - 2 * mid);
    up_right = min(up_right, x + y + 2 * mid);
    down_right = min(down_right, x - y + mid);
    up_left = max(up_left, x - y - mid);
  }
  if (left > right || down > up || down_left > up_right || up_left > down_right)
    return make_pair(-1, -1);
  for (long long x = left; x <= right; x++) {
    long long low_y = down, high_y = up;
    low_y = max(low_y, max(down_left - x, x - down_right));
    high_y = min(high_y, min(up_right - x, x - up_left));
    if (low_y <= high_y) return make_pair(x, low_y);
  }
  return make_pair(-1, -1);
}
signed main() {
  cin >> n;
  for (long long i = 1; i <= n; i++) {
    string s;
    cin >> s;
    for (long long j = 0; j < s.length(); j++) {
      if (s[j] == 'B')
        coor[i].first++;
      else
        coor[i].second++;
    }
  }
  long long l = 0, r = N;
  pair<long long, long long> res;
  pair<long long, long long> tmp;
  long long ans;
  while (l <= r) {
    long long mid = (l + r) >> 1;
    tmp = ok(mid);
    if (tmp.first == -1) {
      l = mid + 1;
    } else {
      ans = mid;
      res = tmp;
      r = mid - 1;
    }
  }
  cout << ans << endl;
  for (long long i = 1; i <= res.first; i++) cout << "B";
  for (long long i = 1; i <= res.second; i++) cout << "N";
  return 0;
}
