# Process input
chips = input().split()
n = int(chips[0])
arrS = chips[1: 1+n]
sx = chips[1+n]
k = int(chips[2+n])

# Find siblings
protoDict = {}
for ch in sx:
    cnt = protoDict.get(ch)
    if cnt:
        protoDict[ch] = cnt + 1
    else:
        protoDict[ch] = 1
siblings = []
for s in arrS:
    if len(s) != len(sx):
        continue
    if s == sx:
        continue
    cntDict = protoDict.copy()
    bMatch = True
    for ch in s:
        cnt = cntDict.get(ch)
        if cnt:
            cntDict[ch] = cnt - 1
        else:
            bMatch = False
            break
    if bMatch:
        siblings.append(s)

# Sort and output
print(len(siblings))
if len(siblings) >= k:
    siblings.sort()
    print(siblings[k-1])