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.*;
import java.util.Collection;
import java.util.LinkedList;
import java.util.StringTokenizer;

/**
 * 557E
 * <p/>
 * θ(|s|^2) time,
 * θ(|s|^2) space.
 * Both time and space can be reduced to θ(|s|) best-time and θ(|s|^2) worst-time.
 *
 * @author artyom
 */
public class _557E implements Runnable {
    private BufferedReader in;
    private StringTokenizer tok;
    private String s;
    private boolean[][] hp;
    private int cnt;
    private int k;

    private Object solve() throws IOException {
        s = nextToken();
        int n = s.length();
        hp = new boolean[n][n + 1]; // Position-length
        for (int i = 0; i < n; i++) {
            // Odd-length half-palindromes
            for (int j = 0; i >= j && i + j < n; j += 2) {
                if (s.charAt(i - j) == s.charAt(i + j)) {
                    hp[i - j][j * 2 + 1] = true;
                } else {
                    break;
                }
            }
            for (int j = 1; i >= j && i + j < n; j += 2) {
                if (s.charAt(i - j) == s.charAt(i + j)) {
                    hp[i - j][j * 2 + 1] = true;
                } else {
                    break;
                }
            }
            // Even-length half-palindromes
            for (int j = 1; i + 1 >= j && i + j < n; j += 2) {
                if (s.charAt(i - j + 1) == s.charAt(i + j)) {
                    hp[i - j + 1][j * 2] = true;
                } else {
                    break;
                }
            }
            for (int j = 2; i + 1 >= j && i + j < n; j += 2) {
                if (s.charAt(i - j + 1) == s.charAt(i + j)) {
                    hp[i - j + 1][j * 2] = true;
                } else {
                    break;
                }
            }
        }
        SuffixTreeNode root = buildSuffixTree(s + '{');
        preprocess(root);
        k = nextInt();
        cnt = 0;
        for (SuffixTreeNode child : root.activeChildren) {
            String res = find(child);
            if (res != null) {
                return res;
            }
        }
        return null; // Should never happen
    }

    private static void preprocess(SuffixTreeNode node) {
        if (node.isLeaf()) {
            node.leaves = 1;
            node.number = node.position;
        } else {
            node.activeChildren = new LinkedList<>();
            for (SuffixTreeNode child : node.children) {
                if (child != null) {
                    preprocess(child);
                    node.leaves += child.leaves;
                    node.activeChildren.add(child);
                    node.number = child.number;
                }
            }
        }
    }

    private String find(SuffixTreeNode node) {
        for (int d = node.parent.depth() + 1, maxD = node.isLeaf() ? node.depth() - 1 : node.depth(); d <= maxD; d++) {
            if (hp[node.number][d]) {
                cnt += node.leaves;
                if (cnt >= k) {
                    return s.substring(node.number, node.number + d);
                }
            }
        }
        if (!node.isLeaf()) {
            for (SuffixTreeNode child : node.activeChildren) {
                String res = find(child);
                if (res != null) {
                    return res;
                }
            }
        }
        return null;
    }

    //--------------------------------------------------------------
    public static void main(String[] args) {
        new _557E().run();
    }

    @Override
    public void run() {
        try {
            in = new BufferedReader(new InputStreamReader(System.in));
            tok = null;
            System.out.print(solve());
            in.close();
        } catch (IOException e) {
            System.exit(0);
        }
    }

    private String nextToken() throws IOException {
        while (tok == null || !tok.hasMoreTokens()) {
            tok = new StringTokenizer(in.readLine());
        }
        return tok.nextToken();
    }

    private int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }

    @SuppressWarnings("ConstantConditions")
    private static SuffixTreeNode buildSuffixTree(CharSequence s) {
        int n = s.length();
        byte[] a = new byte[n];
        for (int i = 0; i < n; i++) {
            a[i] = (byte) (s.charAt(i) - 'a');
        }
        SuffixTreeNode root = new SuffixTreeNode(0, 0, 0, null, null);
        SuffixTreeNode node = root;
        for (int i = 0, tail = 0; i < n; i++, tail++) {
            SuffixTreeNode last = null;
            while (tail >= 0) {
                SuffixTreeNode ch = node.children[a[i - tail]];
                while (ch != null && tail >= ch.length()) {
                    tail -= ch.length();
                    node = ch;
                    ch = ch.children[a[i - tail]];
                }
                if (ch == null) {
                    node.children[a[i]] = new SuffixTreeNode(i, n, node.depth(), i, node);
                    if (last != null) {
                        last.suffixLink = node;
                    }
                    last = null;
                } else {
                    byte t = a[ch.start + tail];
                    if (t == a[i]) {
                        if (last != null) {
                            last.suffixLink = node;
                        }
                        break;
                    } else {
                        SuffixTreeNode splitNode = new SuffixTreeNode(ch.start, ch.start + tail, node.depth(), null, node);
                        splitNode.children[a[i]] = new SuffixTreeNode(i, n, ch.depth + tail, i, splitNode);
                        splitNode.children[t] = ch;
                        ch.start += tail;
                        ch.depth += tail;
                        ch.parent = splitNode;
                        node.children[a[i - tail]] = splitNode;
                        if (last != null) {
                            last.suffixLink = splitNode;
                        }
                        last = splitNode;
                    }
                }
                if (node == root) {
                    tail--;
                } else {
                    node = node.suffixLink;
                }
            }
        }
        return root;
    }

    private static final class SuffixTreeNode {
        int depth; // The number of characters from root to this node
        int start; // Inclusive
        int end; // Exclusive
        Integer position;
        int number;
        SuffixTreeNode parent;
        final SuffixTreeNode[] children;
        Collection<SuffixTreeNode> activeChildren;
        SuffixTreeNode suffixLink;
        // Additional properties
        int leaves;

        private SuffixTreeNode(int start, int end, int depth, Integer position, SuffixTreeNode parent) {
            this.start = start;
            this.end = end;
            this.parent = parent;
            this.depth = depth;
            if (position == null) {
                this.position = null;
                this.children = new SuffixTreeNode[27];
            } else {
                this.position = position - depth;
                // Save some space and time
                this.children = null;
            }
        }

        boolean isLeaf() {
            return position != null;
        }

        /**
         * @return the number of characters on the edge to the parent.
         */
        final int length() {
            return end - start;
        }

        /**
         * @return the number of characters on the path from the root to this node.
         */
        final int depth() {
            return depth + end - start;
        }

        @Override
        public String toString() {
            return "(" + start + ',' + (end - 1) + ')';
        }
    }
}