Tomorrow Ann takes the hardest exam of programming where she should get an excellent mark. 

On the last theoretical class the teacher introduced the notion of a half-palindrome. 

String t is a half-palindrome, if for all the odd positions i (<image>) the following condition is held: ti = t|t| - i + 1, where |t| is the length of string t if positions are indexed from 1. For example, strings "abaa", "a", "bb", "abbbaa" are half-palindromes and strings "ab", "bba" and "aaabaa" are not.

Ann knows that on the exam she will get string s, consisting only of letters a and b, and number k. To get an excellent mark she has to find the k-th in the lexicographical order string among all substrings of s that are half-palyndromes. Note that each substring in this order is considered as many times as many times it occurs in s.

The teachers guarantees that the given number k doesn't exceed the number of substrings of the given string that are half-palindromes.

Can you cope with this problem?

Input

The first line of the input contains string s (1 ≤ |s| ≤ 5000), consisting only of characters 'a' and 'b', where |s| is the length of string s.

The second line contains a positive integer k — the lexicographical number of the requested string among all the half-palindrome substrings of the given string s. The strings are numbered starting from one. 

It is guaranteed that number k doesn't exceed the number of substrings of the given string that are half-palindromes.

Output

Print a substring of the given string that is the k-th in the lexicographical order of all substrings of the given string that are half-palindromes.

Examples

Input

abbabaab
7


Output

abaa


Input

aaaaa
10


Output

aaa


Input

bbaabb
13


Output

bbaabb

Note

By definition, string a = a1a2... an is lexicographically less than string b = b1b2... bm, if either a is a prefix of b and doesn't coincide with b, or there exists such i, that a1 = b1, a2 = b2, ... ai - 1 = bi - 1, ai < bi.

In the first sample half-palindrome substrings are the following strings — a, a, a, a, aa, aba, abaa, abba, abbabaa, b, b, b, b, baab, bab, bb, bbab, bbabaab (the list is given in the lexicographical order). 
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskE solver = new TaskE();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskE {
        int[] count;
        int[] subtree;
        int[] left;
        int[] right;
        int current;

        public void solve(int testNumber, InputReader in, PrintWriter out) {
            char[] S = in.next().toCharArray();
            int N = S.length, K = in.nextInt();

            boolean[][] isPal = new boolean[N][N];

            for (int len = 1; len <= N; len++) {
                for (int i = 0; i + len <= N; i++) {
                    int j = i + len - 1;
                    isPal[i][j] = S[i] == S[j] && (i + 2 > j - 2 || isPal[i + 2][j - 2]);
                }
            }
            

            int M = N * (N + 1) / 2 + 3;
            subtree = new int[M];
            count = new int[M];
            left = new int[M];
            right = new int[M];
            current = 1;

            for (int i = 0; i < N; ++i)
                add(0, S, i, isPal[i]);

            StringBuffer ans = new StringBuffer();
            getKth(0, K, ans);

            out.println(ans.toString());
        }

        private int add(int node, char[] S, int index, boolean[] isPal) {
            int ret = 0;

            if (index > 0 && isPal[index - 1]) {
                count[node]++;
                ret++;
            }

            if (index != S.length) {
                if (S[index] == 'a') {
                    if (left[node] == 0) left[node] = current++;
                    ret += add(left[node], S, index + 1, isPal);
                } else {
                    if (right[node] == 0) right[node] = current++;
                    ret += add(right[node], S, index + 1, isPal);
                }
            }

            subtree[node] += ret;
            return ret;
        }

        private void getKth(int node, int K, StringBuffer dest) {
            if (K <= count[node]) return;
            K -= count[node];
            if (left[node] != 0 && K <= subtree[left[node]]) {
                dest.append('a');
                getKth(left[node], K, dest);
            } else {
                if (left[node] != 0) K -= subtree[left[node]];
                dest.append('b');
                getKth(right[node], K, dest);
            }
        }

    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars == -1)
                throw new UnknownError();
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new UnknownError();
                }
                if (numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public String next() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            StringBuffer res = new StringBuffer();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isSpaceChar(c));

            return res.toString();
        }

        private boolean isSpaceChar(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

    }
}