import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time



sys.setrecursionlimit(10**7)

inf=10**20

mod=10**9+7



def LI(): return list(map(int,input().split()))

def I(): return int(eval(input()))

def LS(): return input().split()

def S(): return eval(input())



def main():

  s=S()

  k=I()



  l=[]



  for i in range(len(s)):

    l.append(s[i])

    l.append(s[i:i+2])

    l.append(s[i:i+3])

    l.append(s[i:i+4])

    l.append(s[i:i+5])



  l=list(set(l))

  l.sort()



  return l[k-1]



print((main()))

import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time



sys.setrecursionlimit(10**7)

inf=10**20

mod=10**9+7



def LI(): return list(map(int,input().split()))

def I(): return int(eval(input()))

def LS(): return input().split()

def S(): return eval(input())



def main():

  s=S()

  k=I()



  l=[]

  for i in range(len(s)):

    for j in range(1,6):

      l.append(s[i:i+j])



  l=list(set(l))

  l.sort()



  return l[k-1]



print((main()))

import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7


def LI():
    return list(map(int, input().split()))


def I():
    return int(eval(input()))


def LS():
    return input().split()


def S():
    return eval(input())


def main():
    s = S()
    k = I()
    l = []
    for i in range(len(s)):
        l.append(s[i])
        l.append(s[i : i + 2])
        l.append(s[i : i + 3])
        l.append(s[i : i + 4])
        l.append(s[i : i + 5])
    l = list(set(l))
    l.sort()
    return l[k - 1]


print((main()))

import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7


def LI():
    return list(map(int, input().split()))


def I():
    return int(eval(input()))


def LS():
    return input().split()


def S():
    return eval(input())


def main():
    s = S()
    k = I()
    l = []
    for i in range(len(s)):
        for j in range(1, 6):
            l.append(s[i : i + j])
    l = list(set(l))
    l.sort()
    return l[k - 1]


print((main()))

-        l.append(s[i]) -        l.append(s[i : i + 2]) -        l.append(s[i : i + 3]) -        l.append(s[i : i + 4]) -        l.append(s[i : i + 5]) +        for j in range(1, 6): +            l.append(s[i : i + j])