/*
  All this dirty code written by avm.
*/

/*
   Quick solution(2) failed on 05 test
   Sort letters frequences + Greedy
*/

import java.util.*;
import java.io.*;
public class road_am_q2
  {
  static final String filename = "road";
  static final boolean DEBUG_OUTPUT = false;
  static BufferedReader in;
  static PrintStream out;
  static int k,n,m;
  static BitSet all,best;
  static BitSet e[];
  static int nSymbols,res;

  static class Letter implements Comparable<Letter>
    {
    int id;
    int score;
    public Letter (int _id,int _score) {id = _id;score = _score;}
    public int compareTo(Letter a)
      {
      if (score != a.score) return score < a.score ? -1 : 1;
      if (id == a.id) return 0;
      return id < a.id ? -1 : 1;
      }

    }

  static void add(BitSet cur,int idx)
    {
    for(int i=0;i<nSymbols;i++) if (cur.get(i)) e[i].set(idx);
    }
  static void go(BitSet A,BitSet bits,int depth,int sum)
    {
    if (sum >= res) return;
    if (DEBUG_OUTPUT)
      {
      out.println("A = " + A.toString());
      out.println("bits = " + bits.toString());
      out.println("depth = " + Integer.toString(depth));
      out.println("sum = " + Integer.toString(sum));
      }
    if (A.equals(all))
      {
      res = sum;
      best = (BitSet) bits.clone();
      }
    else
      {
      if (depth < nSymbols)
        {
        go(A,bits,depth+1,sum);
        bits.set(depth);
        BitSet B = (BitSet) A.clone();
        B.or(e[depth]);
        go(B,bits,depth+1,sum+1);
        bits.clear(depth);
        }
      }
    }
  static void test() throws IOException
    {
    int i,j;
    String s = in.readLine();
    k = Integer.parseInt(s);
    s = in.readLine();
    n = s.length();
    m = n - k + 1;
    int[] a = new int[n];
    int[] b = new int[26];
    for(i=0;i<n;i++)
      {
      a[i] = s.charAt(i) - 'A';
      b[a[i]]++;
      }
    nSymbols = 0;
    j = 0;
    for(i=0;i<26;i++) if (b[i] > 0) nSymbols++;
    int[] c = new int[nSymbols];
    for(i=0;i<26;i++) if (b[i] > 0)
      {
      c[j] = i;
      b[i] = j;
      j++;
      }
    for(i=0;i<n;i++) a[i] = b[a[i]];

    BitSet A = new BitSet(m);
    all = new BitSet(m);
    all.set(0,m,true);
    e = new BitSet[nSymbols];
    for(i=0;i<nSymbols;i++) e[i] = new BitSet(m);
    int cnt[] = new int[nSymbols];
    for(i=0;i<k;i++) cnt[a[i]]++;
    BitSet cur = new BitSet(nSymbols);
    for(i=0;i<nSymbols;i++) if (cnt[i]>0) cur.set(i);
    add(cur,0);
    j = 1;
    for(i=k;i<n;i++)
      {
      cnt[a[i-k]]--;
      if (cnt[a[i-k]] == 0) cur.clear(a[i-k]);
      if (cnt[a[i]] == 0) cur.set(a[i]);
      cnt[a[i]]++;
      add(cur,j++);
      }
    res = Integer.MAX_VALUE;
    if (DEBUG_OUTPUT)
      {
      out.print("alphabet:");
      for(i=0;i<nSymbols;i++) out.print((char) ('A' + c[i]));
      out.println();
      for(i=0;i<n;i++) out.print((char) ('A' + c[a[i]]));
      out.println();
      for(i=0;i<nSymbols;i++) out.println("e[" + Integer.toString(i) + "] = " + e[i].toString());
      }

    Letter C[] = new Letter[nSymbols];
    for(i=0;i<nSymbols;i++) C[i] = new Letter(i,0);
    for(i=0;i<n;i++) C[a[i]].score++;
    Arrays.sort(C);  
    BitSet best = new BitSet(nSymbols);
    res = 0;
    for(i=nSymbols-1;i>=0;i--)
      {
      res++;
      A.or(e[C[i].id]);
      best.set(C[i].id);
      if (A.equals(all)) break;
      }
    //go(A,new BitSet(nSymbols),0,0);
    out.println(res);
    for(i=0;i<nSymbols;i++) if (best.get(i))
      out.println((char)('A' + c[i]));
    }
  public static void main (String[] argv) throws IOException
    {
    in = new BufferedReader(new InputStreamReader(new FileInputStream(filename+ ".in")));
    out = new PrintStream(new BufferedOutputStream(new FileOutputStream(filename + ".out"))); 
    test();
    in.close();
    out.close();
    }
  }

