'''
在给出的字典单词中,找出x的兄弟单词,字典式排序,找到第k个
不用输出x所有的兄弟单词。。。。
'''
info=input().split()
n=int(info[0])
dict_word=info[1:-1]
x=info[-2]  # n不确定,需要倒着数
k=int(info[-1])

cnt=0
l=[]
for i in dict_word:
    if i!=x and sorted(i)==sorted(x):
        cnt += 1
        l.append(i)
l_sort=sorted(l)        
print(cnt)
if len(l_sort)>=k:
    print(l_sort[k-1])
else:
    print()