[n, *ss, x, k] = input().split()
k = int(k) - 1
len_x = len(x)
std_x = sorted(x)
bro = sorted([s for s in ss if s != x and len(s) == len_x and sorted(s) == std_x])
count = len(bro)
print(f"{count}\n{bro[k]}" if count > k else count)