import java.util.*;
import java.io.*;

public class road_vv_fast{

  BufferedReader in;
  PrintWriter out;

  static final int MaxK = 26, MaxL = 1 << MaxK, MOVE = 5,
   MaxP = 1 << (MaxK - MOVE);

  int[] f;

  public void put(int cc){
    if (ex(cc)) return;
//    System.out.println("Put+" +cc);    
    f[cc>>MOVE] |= (1<< (cc & 31));
  }

  public boolean ex(int cc){
    return (f[cc>>MOVE] & (1<< (cc & 31) ))!=0;
  }

  String FILE_NAME = "road";
  int QQ = MaxK;

  public void run() throws Exception{
    in = new BufferedReader(new FileReader(new File(FILE_NAME+".in")));
    out = new PrintWriter(new BufferedWriter(new FileWriter(new File(FILE_NAME+".out"))));
    f = new int[1<<(QQ-MOVE)];
    int k = Integer.parseInt(in.readLine());
    String a= in.readLine();
    int s = a.length();
    if (s<k) 
      throw new Exception("BOTVA");
    int[] x = new int[QQ];
    for(int i=0;i<k;i++){
      x[a.charAt(i)-'A']++;
    }
    int cc = 0;
    for(int i=0;i<QQ;i++){
      if (x[i]>0) cc+= (1<<i);
    }
    put((1<<QQ)-1-cc);
    for(int i=k;i<a.length();i++){
      int c;
      c = a.charAt(i-k) - 'A';
      x[c]--;
      if (x[c]==0)
        cc-=(1<<(c));
      c = a.charAt(i) - 'A';
      x[c]++;
      if (x[c]==1)
        cc+=(1<<c);
      put((1<<QQ)-1-cc);
    }

    for (int i = MaxP - 1; i >= 0; i--)
    {
      f[i] |= (f[i] & 0xAAAAAAAA) >> 1;
      f[i] |= (f[i] & 0xCCCCCCCC) >> 2;
      f[i] |= (f[i] & 0xF0F0F0F0) >> 4;
      f[i] |= (f[i] & 0xFF00FF00) >> 8;
      f[i] |= (f[i] & 0xFFFF0000) >> 16;
    }
    for (int j = 1; j < MaxP; j <<= 1)
      for (int i = MaxP - 1; i >= 0; i--) if ((i & j) > 0)
        f[i - j] |= f[i];

    cc=(1<<QQ)-1;
    int qq = QQ;
    for (int i = MaxL - 1; i >= 0; i--)
      if ((f[i >> MOVE] & (1 << i)) == 0)
      {
        int j;
        j = (i & 0x55555555) + ((i & 0xAAAAAAAA) >> 1);
        j = (j & 0x33333333) + ((j & 0xCCCCCCCC) >> 2);
        j = (j & 0x0F0F0F0F) + ((j & 0xF0F0F0F0) >> 4);
        j = (j & 0x00FF00FF) + ((j & 0xFF00FF00) >> 8);
        j = (j & 0x0000FFFF) + ((j & 0xFFFF0000) >> 16);
        if (qq > j)        
        {
          qq = j;
          cc = i;
        }
      }

    out.println(qq);
    for (int i=0;i<QQ;i++)
      if (((1<<i) & cc)!=0) out.println((char)('A'+i));
  }



  public void close(){
    out.close();
  }
  public static void main(String[] args) throws Exception{
    road_vv_fast a= new road_vv_fast();
    a.run();
    a.close();
  }
}
