s = eval(input())

K = int(eval(input()))

l = [chr(i) for i in range(97, 97+26)]

selected = []

for i in l:

  if i in s:

    index = []

    for ind, j in enumerate(s):

      if i == j:

        index.append(ind)

    for j in index:

      temp = []

      for k in range(5):

        if j+k == len(s) or len(temp)>=K:

          break

        selected.append(s[j:j+k+1])

    selected=list(set(selected))

    selected.sort()

    if len(selected)>=K:

      print((selected[K-1]))

      break

s = eval(input())

K = int(eval(input()))

l = [chr(i) for i in range(97, 97+26)]

selected = []

for i in l:

  if i in s:

    index = []

    for ind, j in enumerate(s):

      if i == j:

        index.append(ind)

    for j in index:

      for k in range(K):

        if j+k == len(s):

          break

        selected.append(s[j:j+k+1])

    selected=list(set(selected))

    selected.sort()

    if len(selected)>=K:

      print((selected[K-1]))

      break

s = eval(input())
K = int(eval(input()))
l = [chr(i) for i in range(97, 97 + 26)]
selected = []
for i in l:
    if i in s:
        index = []
        for ind, j in enumerate(s):
            if i == j:
                index.append(ind)
        for j in index:
            temp = []
            for k in range(5):
                if j + k == len(s) or len(temp) >= K:
                    break
                selected.append(s[j : j + k + 1])
        selected = list(set(selected))
        selected.sort()
        if len(selected) >= K:
            print((selected[K - 1]))
            break

s = eval(input())
K = int(eval(input()))
l = [chr(i) for i in range(97, 97 + 26)]
selected = []
for i in l:
    if i in s:
        index = []
        for ind, j in enumerate(s):
            if i == j:
                index.append(ind)
        for j in index:
            for k in range(K):
                if j + k == len(s):
                    break
                selected.append(s[j : j + k + 1])
        selected = list(set(selected))
        selected.sort()
        if len(selected) >= K:
            print((selected[K - 1]))
            break

-            temp = [] -            for k in range(5): -                if j + k == len(s) or len(temp) >= K: +            for k in range(K): +                if j + k == len(s):