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). 
#include <bits/stdc++.h>
long long mpow(long long a, long long n, long long mod) {
  long long ret = 1;
  long long b = a;
  while (n) {
    if (n & 1) ret = (ret * b);
    b = (b * b);
    n >>= 1;
  }
  return (long long)ret;
}
using namespace std;
string s;
vector<pair<pair<int, int>, int> > L;
int dp[20][100005];
int suffArr[100005];
long long len;
int lcparr[100005];
bool can[5001][5001];
int cnt[100005];
int lcp(int x, int y) {
  long long ret = 0;
  if (x == y) return len - x;
  for (long long h = 20; h >= 0 && x < len && y < len; h--) {
    if ((1 << h) < (long long)len && dp[h][x] == dp[h][y]) {
      ret += (1 << h);
      x = (x + (1 << h));
      y = (y + (1 << h));
    }
  }
  return ret;
}
int main() {
  long long i, j, n;
  cin >> s >> n;
  len = s.size();
  if (len == 1) {
    cout << s;
    return 0;
  }
  for (j = 0; j < len; j++) {
    dp[0][j] = s[j] - 'a';
  }
  for (long long k = 1; k < 20; k++) {
    if (1 << (k - 1) >= len) break;
    L.clear();
    for (j = 0; j < len; j++) {
      if (j + (1 << k) >= len) dp[k - 1][j + (1 << k)] = -1;
      L.push_back(
          make_pair(make_pair(dp[k - 1][j], dp[k - 1][j + (1 << (k - 1))]), j));
    }
    sort(L.begin(), L.end());
    for (j = 0; j < len; j++) {
      dp[k][L[j].second] =
          (j > 0 && (L[j].first.first == L[j - 1].first.first) &&
           (L[j].first.second == L[j - 1].first.second))
              ? dp[k][L[j - 1].second]
              : j;
    }
  }
  for (j = 0; j < len; j++) {
    suffArr[j] = L[j].second;
  }
  for (i = 0; i < len - 1; i++) {
    lcparr[i] = lcp(suffArr[i], suffArr[i + 1]);
  }
  for (i = 0; i < len; i++) can[i][i] = 1;
  for (i = 0; i < len - 1; i++) can[i][i + 1] = (s[i] == s[i + 1]);
  for (i = 0; i < len - 2; i++) can[i][i + 2] = (s[i] == s[i + 2]);
  for (i = 0; i < len - 3; i++) can[i][i + 3] = (s[i] == s[i + 3]);
  for (i = 4; i < len; i++) {
    for (j = 0; j < len - i; j++) {
      can[j][j + i] = (can[j + 2][j + i - 2] && s[j] == s[j + i]);
      can[j][j + i + 1] = (can[j + 2][j + i - 1] && s[j] == s[j + i + 1]);
    }
  }
  for (i = 0; i < len; i++) {
    for (j = suffArr[i] + cnt[i]; j < len; j++) {
      int l = j - suffArr[i] + 1, p = i;
      if (can[suffArr[i]][j]) {
        do {
          cnt[p] = l;
          n--;
          p++;
        } while (p < len && lcparr[p - 1] >= l);
      }
      if (n <= 0) {
        cout << s.substr(suffArr[i], l);
        return 0;
      }
    }
  }
  return 0;
}
