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

public class road_vv{

  BufferedReader in;
  PrintWriter out;


  short[] g;

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

  public boolean ex(int cc){
    return (g[cc>>3] & (1<< (cc & 7) ))!=0;
  }

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

  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"))));
    g = new short[1<<(QQ-3)];
    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);
    }
//    if (true) return;
    for(int i=(1<<QQ)-1;i>=0;i--){
      if (ex(i)){
        for(int j=0;j<QQ;j++)
          if (((1<<j) & i)!=0){
            put(i-(1<<j));
          }
      }
    }
//    System.out.println("!!");
    cc=(1<<QQ)-1;
    int qq = QQ;
    for(int i=0;i<(1<<QQ)-1;i++){
      if (!ex(i)){
        int jj=i;
        int t = 0;
        while (jj!=0){
          t+=jj & 1;
          jj>>=1;
        }
        if (qq>t){
          qq = t;
          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 a= new road_vv();
    a.run();
    a.close();
  }
}