import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigInteger;
import java.text.SimpleDateFormat;
import java.util.*;
public class Main {
public static void main(String[] args) throws IOException {
BigInteger bg;
boolean found = false;
BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
String line = null;
line = bf.readLine();
String[] LK = line.split(" ");
int K = Integer.parseInt(LK[1]);
int L = Integer.parseInt(LK[0]);
line=bf.readLine();
for (int i = 0; i < line.length()-K+1; i++) {
bg = new BigInteger(line.substring(i,i+K));
if (bg.isProbablePrime(12)) {
int subLength = bg.toString().length();
if(subLength<K)
{
for (int j = 0; j < K-subLength; j++) {
System.out.print(0);
}
System.out.println(bg);
found = true;
break;
}
else {
System.out.println(bg);
found = true;
break;
}
}
}
if (found == false) {
System.out.println("404");
}
}
}
注意:1、subString左闭右开 2、0一定要补上输出,不然格式不对