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.*;

public class E implements Runnable{
	public static void main (String[] args) {new Thread(null, new E(), "_cf", 1 << 28).start();}

	int curNode = 1;
	int[] par, sum, ends;
	int[][] trie;
	StringBuilder sb;
	
	public void run() {
		FastScanner fs = new FastScanner();
		PrintWriter out = new PrintWriter(System.out);
		System.err.println("Go!");

		String str = fs.next();
		int n = str.length();
		int k = fs.nextInt();

		boolean[][] half = new boolean[n][n];
		for(int len = 0; len < n; len++) {
			for(int i = 0; i+len < n; i++) {
				if(len == 0) half[i][len] = true;
				else if(len == 1) 
					half[i][len] = str.charAt(i) == str.charAt(i+1);
				else {
					int add = len/4;
					boolean works = str.charAt(i)==str.charAt(i+len);
					if(add>0) works &= half[i+2][len-4];
					half[i][len] = works;
				}
			}
		}
		
		int max = n*(n+1)/2+10;
		par = new int[max];
		sum = new int[max];
		ends = new int[max];
		trie = new int[2][max];
		char[] st = str.toCharArray();
		for(int i = n-1; i >= 0; i--)
			insert(st, i, half);
		sb = new StringBuilder();
		find(k);
		out.println(sb);
		
		out.close();
	}
	
	void find(int k) {
		int at = 0;
		while(true) {
			if(ends[at] >= k) break;
			k -= ends[at];
			for(int idx = 0; idx < 2; idx++) {
				if(trie[idx][at] != 0) {
					int to = trie[idx][at];
					if(sum[to] >= k) {
						at = to;
						sb.append((char)('a'+idx));
						break;
					}
					else k -= sum[to];
				}
			}
		}
	}
	
	void insert(char[] str, int i, boolean[][] works) {
		int at = 0, len = 0;
		for(int k = i; k < str.length; k++) {
			int j = str[k]-'a';
			if(trie[j][at] == 0) {
				trie[j][at] = curNode++;
				par[trie[j][at]] = at;
			}
			at = trie[j][at];
			len++;
		}
		--len;
		int sum = 0;
		while(true) {
			if(works[i][len]) {
				ends[at]++;
				sum++;
			}
			len--;
			this.sum[at] += sum;
			at = par[at];
			if(at == 0) break;
		}
	}

	class FastScanner {
		public int BS = 1<<16;
		public char NC = (char)0;
		byte[] buf = new byte[BS];
		int bId = 0, size = 0;
		char c = NC;
		double num = 1;
		BufferedInputStream in;

		public FastScanner() {
			in = new BufferedInputStream(System.in, BS);
		}

		public FastScanner(String s) throws FileNotFoundException {
			in = new BufferedInputStream(new FileInputStream(new File(s)), BS);
		}

		public char nextChar(){
			while(bId==size) {
				try {
					size = in.read(buf);
				}catch(Exception e) {
					return NC;
				}                
				if(size==-1)return NC;
				bId=0;
			}
			return (char)buf[bId++];
		}

		public int nextInt() {
			return (int)nextLong();
		}

		public long nextLong() {
			num=1;
			boolean neg = false;
			if(c==NC)c=nextChar();
			for(;(c<'0' || c>'9'); c = nextChar()) {
				if(c=='-')neg=true;
			}
			long res = 0;
			for(; c>='0' && c <='9'; c=nextChar()) {
				res = (res<<3)+(res<<1)+c-'0';
				num*=10;
			}
			return neg?-res:res;
		}

		public double nextDouble() {
			double cur = nextLong();
			return c!='.' ? cur:cur+nextLong()/num;
		}

		public String next() {
			StringBuilder res = new StringBuilder();
			while(c<=32)c=nextChar();
			while(c>32) {
				res.append(c);
				c=nextChar();
			}
			return res.toString();
		}

		public String nextLine() {
			StringBuilder res = new StringBuilder();
			while(c<=32)c=nextChar();
			while(c!='\n') {
				res.append(c);
				c=nextChar();
			}
			return res.toString();
		}

		public boolean hasNext() {
			if(c>32)return true;
			while(true) {
				c=nextChar();
				if(c==NC)return false;
				else if(c>32)return true;
			}
		}

		public int[] nextIntArray(int n) {
			int[] res = new int[n];
			for(int i = 0; i < n; i++) res[i] = nextInt();
			return res;
		}

	}

}