/* Another version fast enough */
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>

#define TASKNAME "road"

const int MaxN = 100000, MaxK = 26, MaxL = 1 << MaxK, MOVE = 5,
 MaxP = MaxL >> MOVE;

char s [MaxN];
int a [MaxK];
unsigned int f [MaxP];

int main (void)
{
 int i, j, k, l, m, n;
 freopen (TASKNAME ".in", "rt", stdin);
 freopen (TASKNAME ".out", "wt", stdout);
 while (scanf (" %d", &k) != EOF)
 {
  assert (k >= 1 && k <= MaxN);
  scanf (" %s", s);
  n = strlen (s);
  memset (a, 0, sizeof (a));
  m = MaxL - 1;
  for (i = 0; i < k; i++)
  {
   j = s[i] - 'A';
   assert (j >= 0 && j < MaxK);
   if (a[j] == 0) m ^= 1 << j;
   a[j]++;
  }
  memset (f, 0, sizeof (f));
  f[m >> MOVE] |= 1 << m;
  for ( ; i < n; i++)
  {
   j = s[i - k] - 'A';
   a[j]--;
   if (a[j] == 0) m ^= 1 << j;
   j = s[i] - 'A';
   assert (j >= 0 && j < MaxK);
   if (a[j] == 0) m ^= 1 << j;
   a[j]++;
   f[m >> MOVE] |= 1 << m;
  }
  for (i = MaxP - 1; i >= 0; i--)
  {
   f[i] |= (f[i] & 0xAAAAAAAAU) >> 1;
   f[i] |= (f[i] & 0xCCCCCCCCU) >> 2;
   f[i] |= (f[i] & 0xF0F0F0F0U) >> 4;
   f[i] |= (f[i] & 0xFF00FF00U) >> 8;
   f[i] |= (f[i] & 0xFFFF0000U) >> 16;
  }
  for (j = 1; j < MaxP; j <<= 1)
   for (i = MaxP - 1; i >= 0; i -= j)
    for (l = j; l > 0; l--, i--)
     f[i - j] |= f[i];
  l = -1; m = MaxK + 1;
  for (i = MaxL - 1; i >= 0; i--)
   if (!(f[i >> MOVE] & (1 << i)))
   {
    j = (i & 0x55555555U) + ((i & 0xAAAAAAAAU) >> 1);
    j = (j & 0x33333333U) + ((j & 0xCCCCCCCCU) >> 2);
    j = (j & 0x0F0F0F0FU) + ((j & 0xF0F0F0F0U) >> 4);
    j = (j & 0x00FF00FFU) + ((j & 0xFF00FF00U) >> 8);
    j = (j & 0x0000FFFFU) + ((j & 0xFFFF0000U) >> 16);
    if (m >= j)
    {
     m = j;
     l = i;
    }
   }
  assert (l > 0);
  printf ("%d\n", m);
  for (j = 0; j < MaxK; j++)
   if (l & (1 << j))
    printf ("%c\n", char (j + 'A'));
 }
 return 0;
}
