//
//  main.c
//  Track 80,n-gram????
//
//  Created by Charles.thRay.Lee on 2/1/13.
//  Copyright (c) 2013 Peking University. All rights reserved.
/*
 ??	??-From Whf
 ??
 ?????????n-gram??????????????n ?????????????????????????????????????????????n-gram ????? n ?????????????????????????????????????500????? 1 < n <5? ?????????????????????????????????????????????????1???? NO
 
 ???n=3???????abcdefabcd?
 ????? 3-gram??abc,bcd,cde,def,efa,fab,abc,bcd?????cd?????3-gram?????????abc ? bcd ????2?????????1?????????????
 2
 abc
 bcd
 ????
 ????n
 ???????
 ????
 ??????????????????
 ????
 3
 
 abcdefabcd
 
 ????
 2
 
 abc
 
 bcd
*/


int save(char point[5],char filed[400][5],int check[400],int filedp)
{
    int p=0,k=0;
    for (p=0; p<filedp&&k==0; p++) {
        if (strcmp(point, filed[p])==0)
        {
            check[p]++;
            k=1;
        }
    }
    if (k==0) {
        strcpy(filed[filedp], point);
        filedp++;
    }
    return filedp;
}

int main()
{
    int n,i=0,p=0,filedp=0,max=0;
    long len;
    char s[2000]={'\0'};
    char point[5]={'\0'};
    char filed[400][5]={'\0'};
    int check[400]={0};
    scanf("%d",&n);
    scanf("%s",s);
    
    len=strlen(s);
    for (i=0; i<=len-n; i++) {
        for (p=0; p<n; p++) {
            point[p]=s[p+i];
        }
        filedp=save(point,filed,check,filedp);
    }
    
    for (p=0; p<filedp; p++) {
        if (check[p]>=max) {
            max=check[p];
        }
    }
    
    if (max==0) {
        printf("NO");
    }
    else
    {
        printf("%d\n",max+1);
        
        for (p=0; p<filedp; p++) {
            if (check[p]==max) {
                printf("%s\n",filed[p]);
            }
        }
    }
    
}