#include <bits/stdc++.h>
using namespace std;
struct Trie {
  int sum, cnt;
  Trie* f[2];
  Trie() {
    sum = 0;
    cnt = 0;
    memset(f, 0, sizeof(f));
  }
};
Trie* root = new Trie();
const int MAX = 5005;
int dp[MAX][MAX], k, n;
char s[MAX];
void add(Trie* nod, int i, int j) {
  if (j == n + 1) return;
  int lit = s[j] - 'a';
  if (nod->f[lit] == NULL) nod->f[lit] = new Trie;
  if (dp[i][j]) nod->f[lit]->cnt++;
  add(nod->f[lit], i, j + 1);
}
void dfs(Trie* nod) {
  nod->sum += nod->cnt;
  for (int i = 0; i <= 1; i++)
    if (nod->f[i] != NULL) {
      dfs(nod->f[i]);
      nod->sum += nod->f[i]->sum;
    }
}
void mia(Trie* nod, int k) {
  if (nod->cnt >= k) return;
  k -= nod->cnt;
  if (nod->f[0] != NULL && nod->f[0]->sum >= k) {
    cout << 'a';
    mia(nod->f[0], k);
  } else {
    cout << 'b';
    if (nod->f[0] != NULL) k -= nod->f[0]->sum;
    mia(nod->f[1], k);
  }
}
int main() {
  cin >> (s + 1) >> k;
  n = strlen(s + 1);
  for (int l = 1; l <= n; l++)
    for (int i = 1, j = i + l - 1; j <= n; i++, j++)
      if (s[i] == s[j])
        if (i + 2 >= j - 2)
          dp[i][j] = 1;
        else
          dp[i][j] = dp[i + 2][j - 2];
  for (int i = 1; i <= n; i++) add(root, i, i);
  dfs(root);
  mia(root, k);
  return 0;
}
