from collections import Counter





def solve(string):

    s, k = string.split()

    """

    g = []

    for i in range(len(s)):

        for j in range(i + 1, len(s) + 1):

            g.append(s[i:j])

    g = sorted(set(g))

    return g[int(k)-1]

    """

    k = int(k)

    count = Counter(s)

    chars = sorted(set(s))

    for t in range(min(3, len(chars))):

        tmp = []

        i = s.index(chars[t])

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

        if count[chars[t]] > 1:

            for _ in range(count[chars[t]] - 1):

                i = s.index(chars[t], i + 1)

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

        g = []

        for p in tmp:

            for j in range(1, len(p) + 1):

                g.append(p[:j])

        g = sorted(set(g))

        if len(g) < k:

            k -= len(g)

            continue

        return g[k - 1]





if __name__ == '__main__':

    print((solve('\n'.join([eval(input()), eval(input())]))))

from collections import Counter





def solve(string):

    s, k = string.split()

    k = int(k)

    count = Counter(s)

    chars = sorted(set(s))

    for t in range(min(3, len(chars))):

        tmp = []

        i = s.index(chars[t])

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

        if count[chars[t]] > 1:

            for _ in range(count[chars[t]] - 1):

                i = s.index(chars[t], i + 1)

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

        g = []

        for p in tmp:

            for j in range(1, len(p) + 1):

                g.append(p[:j])

        g = sorted(set(g))

        if len(g) < k:

            k -= len(g)

            continue

        return g[k - 1]





if __name__ == '__main__':

    print((solve('\n'.join([eval(input()), eval(input())]))))

from collections import Counter


def solve(string):
    s, k = string.split()
    """
    g = []
    for i in range(len(s)):
        for j in range(i + 1, len(s) + 1):
            g.append(s[i:j])
    g = sorted(set(g))
    return g[int(k)-1]
    """
    k = int(k)
    count = Counter(s)
    chars = sorted(set(s))
    for t in range(min(3, len(chars))):
        tmp = []
        i = s.index(chars[t])
        tmp.append(s[i : i + 5])
        if count[chars[t]] > 1:
            for _ in range(count[chars[t]] - 1):
                i = s.index(chars[t], i + 1)
                tmp.append(s[i : i + 5])
        g = []
        for p in tmp:
            for j in range(1, len(p) + 1):
                g.append(p[:j])
        g = sorted(set(g))
        if len(g) < k:
            k -= len(g)
            continue
        return g[k - 1]


if __name__ == "__main__":
    print((solve("\n".join([eval(input()), eval(input())]))))

from collections import Counter


def solve(string):
    s, k = string.split()
    k = int(k)
    count = Counter(s)
    chars = sorted(set(s))
    for t in range(min(3, len(chars))):
        tmp = []
        i = s.index(chars[t])
        tmp.append(s[i : i + 5])
        if count[chars[t]] > 1:
            for _ in range(count[chars[t]] - 1):
                i = s.index(chars[t], i + 1)
                tmp.append(s[i : i + 5])
        g = []
        for p in tmp:
            for j in range(1, len(p) + 1):
                g.append(p[:j])
        g = sorted(set(g))
        if len(g) < k:
            k -= len(g)
            continue
        return g[k - 1]


if __name__ == "__main__":
    print((solve("\n".join([eval(input()), eval(input())]))))

-    """ -    g = [] -    for i in range(len(s)): -        for j in range(i + 1, len(s) + 1): -            g.append(s[i:j]) -    g = sorted(set(g)) -    return g[int(k)-1] -    """