using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;

using System.Collections;

class Program
{
    static void Main()
    {
        string s = Console.ReadLine();

        int K = int.Parse(Console.ReadLine());

        var ans = enumerateSubstring(s).Take(K).Last();

        Console.WriteLine(ans);
    }

    static IEnumerable<string> enumerateSubstring(string str)
    {
        HashSet<string> already = new HashSet<string>();

        var q = PriorityQueue<Tuple<string, int>>.Create(itm => itm.Item1, PriorityKind.SmallerIsPrior);

        for(char c = 'a'; c <= 'z'; c++)
        {
            for(int i = 0; i < str.Length; i++)
            {
                if (str[i] == c)
                {
                    q.Enqueue(new Tuple<string, int>(c.ToString(), i));
                }
            }

            while(q.Any())
            {
                var itm = q.Dequeue();
                if (already.Contains(itm.Item1) == false)
                {
                    already.Add(itm.Item1);
                    yield return itm.Item1;
                }

                var idx = itm.Item2;
                if (idx + 1 > str.Length - 1) continue;

                var nextStr = itm.Item1 + str[idx + 1];
                var nextIdx = itm.Item2 + 1;
                q.Enqueue(new Tuple<string, int>(nextStr, nextIdx));
            }
        }
    }
}


static class MathUtil
{
    public static T Max<T>(params T[] datas)
    {
        return datas.Max();
    }

    public static T Min<T>(params T[] datas)
    {
        return datas.Min();
    }

    public static IEnumerable<IEnumerable<int>> GetPermutation(int n)
    {
        if (n == 0)
        {
            yield return Single(0);
            yield break;
        }

        for (int i = 0; i <= n; i++)
        {
            foreach (var x in GetPermutation(n - 1))
            {
                yield return Single(i).Concat(x.Select(itm => itm < i ? itm : itm + 1));
            }
        }
    }

    private static IEnumerable<int> Single(int x)
    {
        yield return x;
    }

    public static IEnumerable<int> EnumeratePrimeNumbers()
    {
        List<int> primes = new List<int>() { 2 };
        yield return 2;

        for (int i = 3; i < int.MaxValue; i++)
        {
            bool isPrime = true;
            int Sqrt = (int)Math.Sqrt(i) + 1;

            foreach (var prime in primes)
            {
                if (prime > Sqrt)
                {
                    break;
                }
                if (i % prime == 0)
                {
                    isPrime = false;
                    break;
                }
            }

            if (isPrime)
            {
                primes.Add(i);
                yield return i;
            }
        }
    }
}

public enum PriorityKind
{
    BiggerIsPrior,
    SmallerIsPrior,
}

public abstract class PriorityQueue<T> : IEnumerable<T>
{
    public static PriorityQueue<T> Create<U>(Func<T, U> prioritySelector, PriorityKind kind)
    {
        return new PriorityQueueInner<T, U>(prioritySelector, kind);
    }

    public abstract IEnumerator<T> GetEnumerator();

    public abstract void Enqueue(T item);

    public abstract T Dequeue();

    IEnumerator IEnumerable.GetEnumerator()
    {
        return this.GetEnumerator();
    }

    /// <summary>
    /// 優先度順に取り出されるキュー
    /// </summary>
    /// <typeparam name="T"></typeparam>
    private class PriorityQueueInner<T, U> : PriorityQueue<T>
    {
        private Comparison<T> comparison;

        private List<T> heap = new List<T>();

        /// <summary>
        /// 優先度を決定するComparisonを指定して初期化
        /// 比較結果が大きいものほど先に出てくる。
        /// </summary>
        /// <param name="comparison"></param>
        public PriorityQueueInner(Func<T, U> prioritySelector, PriorityKind kind)
        {
            var comparer = Comparer<U>.Default;

            Comparison<T> biggerPriorComparison = (T x, T y) =>
            {
                return comparer.Compare(prioritySelector(y), prioritySelector(x));
            };

            Comparison<T> smallerPriorComparison = (T x, T y) =>
            {
                return comparer.Compare(prioritySelector(x), prioritySelector(y));
            };

            if (kind == PriorityKind.BiggerIsPrior)
            {
                this.comparison = biggerPriorComparison;
            }
            else
            {
                this.comparison = smallerPriorComparison;
            }
        }

        public override void Enqueue(T item)
        {
            heap.Add(item);

            int i = heap.Count - 1;
            while (i > 0)
            {
                //親のノードの番号
                int p = (i - 1) / 2;

                //もう逆転していないなら抜ける
                if (comparison(item, heap[p]) >= 0) break;

                //親のノードの数字を下ろして、自分は上に
                heap[i] = heap[p];
                i = p;
            }

            heap[i] = item;
        }

        public override T Dequeue()
        {
            int nextSize = heap.Count - 1;

            T ret = heap[0];

            //根に持ってくる値
            T x = heap[nextSize];

            //根から下ろしていく
            int i = 0;
            while (i * 2 + 1 < nextSize)
            {
                //子同士を比較
                int a = i * 2 + 1;
                int b = i * 2 + 2;
                if (b < nextSize && comparison(heap[a], heap[b]) > 0) a = b;

                //もう逆転していないなら終わり
                if (comparison(heap[a], x) >= 0) break;

                //子の数字を持ち上げる
                heap[i] = heap[a];
                i = a;
            }

            heap[i] = x;
            heap.RemoveAt(nextSize);
            return ret;
        }

        public override IEnumerator<T> GetEnumerator()
        {
            return heap.GetEnumerator();
        }

        public int Count => heap.Count;
    }
}


Measured memory_bytes: 13920