import qualified Data.ByteString.Char8 as B
import qualified Data.Set as ST
import Control.Monad

collect :: B.ByteString -> Int -> [String]
collect bs i
    | B.length bs < i = []
    | otherwise = (B.unpack $ B.take i bs) : (collect (B.tail bs) i)

main = do
    s <- B.getLine
    k <- readLn
    xs <- ST.fromList . concat <$> (forM [1..k] $ \i -> (return $ collect s i)) :: IO (ST.Set String)
    putStrLn $ ST.elemAt (k-1) xs