word_arr = input().split() dict_num = int(word_arr[0]) dict_word = word_arr[1 : dict_num + 1] ref_word = word_arr[dict_num + 1] k = int(word_arr[-1]) brother_word = [] for i in dict_word: if sorted(list(i)) == sorted(list(ref_word)) and i != ref_word: brother_word.append(i) res = sorted(brother_word) try: print(len(brother_word),res[k-1],sep="\n") except: print(len(brother_word))