#include <bits/stdc++.h>
template <typename T>
T Max(T x, T y) {
  return x > y ? x : y;
}
template <typename T>
T Min(T x, T y) {
  return x < y ? x : y;
}
template <typename T>
T Abs(T x) {
  return x < 0 ? -x : x;
}
template <typename T>
T chkmax(T &x, T y) {
  return x = x > y ? x : y;
}
template <typename T>
T &read(T &r) {
  r = 0;
  bool w = 0;
  char ch = getchar();
  while (ch < '0' || ch > '9') w = ch == '-' ? 1 : 0, ch = getchar();
  while (ch >= '0' && ch <= '9')
    r = (r << 3) + (r << 1) + (ch ^ 48), ch = getchar();
  return r = w ? -r : r;
}
const int N = 300010;
const int INF = 100000000;
int n, a[N], b[N];
char ch[N];
bool check(int x) {
  int l1, r1, l2, r2, l3, r3;
  l1 = -INF, r1 = INF;
  l2 = 0, r2 = INF;
  l3 = 0;
  r3 = INF;
  for (int i = 1; i <= n; ++i) {
    l1 = Max(l1, a[i] - b[i] - x);
    r1 = Min(r1, a[i] - b[i] + x);
    l2 = Max(l2, a[i] - x);
    r2 = Min(r2, a[i] + x);
    l3 = Max(l3, b[i] - x);
    r3 = Min(r3, b[i] + x);
  }
  if (l2 < 0 || l3 < 0) return 0;
  if (l1 > r1 || l2 > r2 || l3 > r3) return 0;
  int l4 = l2 - r3, r4 = r2 - l3;
  return r1 >= l4 && l1 <= r4;
}
signed main() {
  read(n);
  if (n == 1) {
    scanf("%s", ch + 1);
    puts("0");
    printf("%s\n", ch + 1);
    return 0;
  }
  for (int i = 1; i <= n; ++i) {
    scanf("%s", ch + 1);
    int len = std::strlen(ch + 1);
    for (int j = 1; j <= len; ++j)
      if (ch[j] == 'N')
        ++a[i];
      else
        ++b[i];
  }
  int l = 0, r = INF, mid, ans = 0;
  while (l <= r) {
    mid = (l + r) >> 1;
    if (check(mid))
      ans = mid, r = mid - 1;
    else
      l = mid + 1;
  }
  printf("%d\n", ans);
  int l1, r1, l2, r2, l3, r3;
  l1 = -INF, r1 = INF;
  l2 = 0, r2 = INF;
  l3 = 0;
  r3 = INF;
  for (int i = 1; i <= n; ++i) {
    l1 = Max(l1, a[i] - b[i] - ans);
    r1 = Min(r1, a[i] - b[i] + ans);
    l2 = Max(l2, a[i] - ans);
    r2 = Min(r2, a[i] + ans);
    l3 = Max(l3, b[i] - ans);
    r3 = Min(r3, b[i] + ans);
  }
  int l4 = l2 - r3, r4 = r2 - l3;
  l = Max(l1, l4);
  r = Min(r1, r4);
  for (int i = l2; i <= r2; ++i) {
    int _l = i - r3, _r = i - l3;
    if (Max(_l, l) <= Min(r, _r)) {
      int p = Max(_l, l);
      if (i || (i - p)) {
        for (int j = 1; j <= i - p; ++j) printf("B");
        for (int j = 1; j <= i; ++j) printf("N");
        return 0;
      } else {
        p = Min(r, _r);
        if (i || (i - p)) {
          for (int j = 1; j <= i - p; ++j) printf("B");
          for (int j = 1; j <= i; ++j) printf("N");
          return 0;
        }
      }
    }
  }
  return 0;
}
