#include <bits/stdc++.h>
using namespace std;
struct Trie {
  int cnt, isword;
  Trie *edge[2];
  Trie() { cnt = isword = 0, edge[0] = edge[1] = 0; }
};
int K, n;
char s[5005];
bool dp[5005][5005];
Trie *root;
string res;
void dfs_calc(Trie *cur) {
  if (!cur) return;
  cur->cnt = cur->isword;
  for (int x = (0); x < (2); ++x)
    if (cur->edge[x]) {
      dfs_calc(cur->edge[x]);
      cur->cnt += cur->edge[x]->cnt;
    }
}
void dfs_res(Trie *cur, int k) {
  if (cur->isword) {
    if (k <= cur->isword) {
      printf("%s", res.c_str());
      return;
    }
    k -= cur->isword;
  }
  if (cur->edge[0] && k <= cur->edge[0]->cnt) {
    res += 'a';
    dfs_res(cur->edge[0], k);
  } else {
    if (cur->edge[0]) k -= cur->edge[0]->cnt;
    res += 'b';
    dfs_res(cur->edge[1], k);
  }
}
int main() {
  scanf("%s%d", s + 1, &K);
  n = strlen(s + 1);
  for (int len = (1); len <= (n); ++len)
    for (int i = (1); i <= (n - len + 1); ++i) {
      int j = i + len - 1;
      if (len <= 4)
        dp[i][j] = s[i] == s[j];
      else
        dp[i][j] = s[i] == s[j] && dp[i + 2][j - 2];
    }
  root = new Trie();
  for (int i = (1); i <= (n); ++i) {
    Trie *ptr = root;
    for (int j = (i); j <= (n); ++j) {
      int x = s[j] - 'a';
      if (!ptr->edge[x]) ptr->edge[x] = new Trie();
      ptr = ptr->edge[x], ptr->isword += dp[i][j];
    }
  }
  dfs_calc(root);
  res = "";
  dfs_res(root, K);
  return 0;
}
