import java.util.*;
import java.io.*;
// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
String line = null;
while((line = bf.readLine()) != null){
String[] words = line.split(" ");
int n = Integer.parseInt(words[0]);
int t = mCode(words[n + 1]);
ArrayList<String> brothers = new ArrayList<String>();
for (int i = 1; i <= n; ++i) {
if (!words[i].equals(words[n + 1]) && mCode(words[i]) == t) {
brothers.add(words[i]);
}
}
brothers.sort(Comparator.naturalOrder());
int which = Integer.parseInt(words[n + 2]);
int size = brothers.size();
System.out.println(size);
if (size >= which) {
System.out.println(brothers.get(which - 1));
}
}
}
public static int mCode(String word) {
int mCode = 1;
for (int i = 0; i < word.length(); ++i) {
mCode *= word.charAt(i);
}
return mCode;
}
}