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* (<img align="middle" class="tex-formula" src="https://espresso.codeforces.com/1495d729d87ff2c28e9afcddb312ddfe867511e1.png" style="max-width: 100.0%;max-height: 100.0%;"/>) the following condition is held: *t*<sub class="lower-index">*i*</sub> = *t*<sub class="lower-index">|*t*| - *i* + 1</sub>, 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?
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.
int T;
int pal[5005][5005];
struct trie{
    struct Vertex{
        vector<int> next;
        bool leaf;
        int cnt,ans;
        Vertex()
        {
            next.resize(26);
            fill(next.begin(),next.end(),-1);
            ans=cnt=0;
            leaf=false;
        }
    };
    vector<Vertex> sh;
    trie()
    {
        sh.emplace_back();
    }
    void add(int i,string s)
    {
        int v=0;
        for(int ch=0;ch<s.size();ch++)
        {
            int c=s[ch]-'a';
            if(sh[v].next[c]==-1)
            {
                sh[v].next[c]=sh.size();
                sh.emplace_back();
            }
            v=sh[v].next[c];
            if(pal[i][i+ch])
            	sh[v].cnt++;
            
        }
        sh[v].leaf=true;
    }
    int init(int x=0)
    {T++;assert(T<=60000000);
    	int ans=sh[x].cnt;
    	for(int i=0;i<26;i++)
    	{
    		if(~sh[x].next[i])
    		{
    			ans+=init(sh[x].next[i]);
    		}
    	}
    	return sh[x].ans=ans;
    }
	void solve(int x,int y)
	{T++;assert(T<=60000000);
		if(sh[x].cnt>=y)
			return ;
		y-=sh[x].cnt;
		for(int i=0;i<26;i++)
		{
 
			int v=sh[x].next[i];
			if(~v)
			{
				if(sh[v].ans>=y)
				{
					char ch ='a'+i;
                    cout<<ch;
					solve(v,y);
					return ;
				}
				else
				{
					y-=sh[v].ans;	
				}
			}
		}
	}
};
 
 
string s;
trie sh;
int main()
{
 FASTIO
	 
    int i,j,k,l,m,n,t,x,y;
    cin>>s;
    for(i=0;i<s.size();i++)
    {
    	int j=0;
    	while(i+j<s.size()&&i-j>=0&&s[i+j]==s[i-j])
    	{
    		pal[i-j][i+j]=1;
    		j+=2;
    	}
    	j=1;
    	while(i+j<s.size()&&i-j>=0&&s[i+j]==s[i-j])
    	{
    		pal[i-j][i+j]=1;
    		j+=2;
    	}
    	j=0;
    	while(i-j-1>=0&&i+j<s.size()&&s[i-j-1]==s[i+j])
    	{
    		pal[i-j-1][i+j]=1;
    		j+=2;
    	}
    	j=1;
    	while(i-j-1>=0&&i+j<s.size()&&s[i-j-1]==s[i+j])
    	{
    		pal[i-j-1][i+j]=1;
    		j+=2;
    	}
    }
/*
    for(i=0;i<s.size();i++)
    {
    	for(j=0;j<s.size();j++)
    	cout<<pal[i][j]<<' ';
    	cout<<endl;
    }
*/
    for(i=0;i<s.size();i++)
    {
    	sh.add(i,s.substr(i));
    	
    }
    sh.init();
    cin>>x;
    sh.solve(0,x);
    return 0;
}
 
		  		  	   		  						  	 	