import sys input_str = sys.stdin.readline().strip().split() n = int(input_str[0]) string = input_str[1 : 1 + n] x = input_str[1 + n] k = int(input_str[-1]) res = [] for s in string: if s != x and ''.join(sorted(s)) == ''.join(sorted(x)): res.append(s) res.sort() print(len(res)) if len(res) >= k: print(res[k - 1])