#include <bits/stdc++.h>
static constexpr int MAXN = 5000;
struct trie_node {
  trie_node* next[2];
  int count;
  int ending_here;
  trie_node() : count(0), ending_here(0) {
    next[0] = nullptr;
    next[1] = nullptr;
  }
  ~trie_node() {
    delete next[0];
    delete next[1];
  }
  int get(int i) {
    if (next[i] == nullptr) return 0;
    return next[i]->count;
  }
};
static int DP[MAXN][MAXN];
static bool is_half_pal(const std::string& str, int left, int right) {
  if (left > right) return true;
  if (str[left] != str[right]) return false;
  int& ref = DP[left][right];
  if (ref != -1) return ref;
  ref = is_half_pal(str, left + 2, right - 2);
  return ref;
}
static trie_node* insert_string(trie_node* node, const std::string& str, int i,
                                int j) {
  if (i > j) {
    node->count++;
    node->ending_here++;
    return node;
  }
  int idx = str[i] - 'a';
  if (node->next[idx] == nullptr) node->next[idx] = new trie_node;
  return insert_string(node->next[idx], str, i + 1, j);
}
static void update_counts(trie_node* node) {
  if (node == nullptr) return;
  update_counts(node->next[0]);
  update_counts(node->next[1]);
  node->count += node->get(0);
  node->count += node->get(1);
}
static std::string get_kth(trie_node* node, int index) {
  if (index <= node->ending_here) return "";
  index -= node->ending_here;
  int amt_left = node->get(0);
  int amt_right = node->get(1);
  if (index <= amt_left) {
    return "a" + get_kth(node->next[0], index);
  } else {
    index -= amt_left;
    return "b" + get_kth(node->next[1], index);
  }
}
int main() {
  std::ios_base::sync_with_stdio(false);
  std::string str;
  std::cin >> str;
  int sorted_index;
  std::cin >> sorted_index;
  trie_node* root = new trie_node;
  std::memset(DP, -1, sizeof(DP));
  for (int i = 0; i < str.size(); i++) {
    trie_node* tmp = root;
    int lastgu = i;
    for (int j = i; j < str.size(); j++) {
      if (is_half_pal(str, i, j)) {
        tmp = insert_string(tmp, str, lastgu, j);
        lastgu = j + 1;
      }
    }
  }
  update_counts(root);
  std::cout << get_kth(root, sorted_index) << std::endl;
  delete root;
  return EXIT_SUCCESS;
}
