s=eval(input())

k=int(eval(input()))



abc='abcdefghijklmnopqrstuvwxyz'



def dfs(keta,ns):

  global cnt

  if ns in s:

    cnt+=1

  if cnt==k:

    print(ns)

    exit()

  if keta==k:

    return



  for i in abc:

    dfs(keta+1,ns+i)



cnt=0

for i in abc:

  if i not in s:

    continue

  dfs(1,i)
s=eval(input())

k=int(eval(input()))



sub=set()

for i in range(k):

  for j in range(len(s)-i):

    sub.add(s[j:j+i+1])



sub=list(sub)

sub.sort()

print((sub[k-1]))
s = eval(input())
k = int(eval(input()))
abc = "abcdefghijklmnopqrstuvwxyz"


def dfs(keta, ns):
    global cnt
    if ns in s:
        cnt += 1
    if cnt == k:
        print(ns)
        exit()
    if keta == k:
        return
    for i in abc:
        dfs(keta + 1, ns + i)


cnt = 0
for i in abc:
    if i not in s:
        continue
    dfs(1, i)

s = eval(input())
k = int(eval(input()))
sub = set()
for i in range(k):
    for j in range(len(s) - i):
        sub.add(s[j : j + i + 1])
sub = list(sub)
sub.sort()
print((sub[k - 1]))

-abc = "abcdefghijklmnopqrstuvwxyz" - - -def dfs(keta, ns): -    global cnt -    if ns in s: -        cnt += 1 -    if cnt == k: -        print(ns) -        exit() -    if keta == k: -        return -    for i in abc: -        dfs(keta + 1, ns + i) - - -cnt = 0 -for i in abc: -    if i not in s: -        continue -    dfs(1, i) +sub = set() +for i in range(k): +    for j in range(len(s) - i): +        sub.add(s[j : j + i + 1]) +sub = list(sub) +sub.sort() +print((sub[k - 1]))