#include <bits/stdc++.h>
using namespace std;
typedef struct a {
  struct a *left, *right;
  int inSubtree;
  int endingHere;
} node;
node* newNode() {
  node* ret = (node*)malloc(sizeof(node));
  ret->left = ret->right = NULL;
  ret->inSubtree = ret->endingHere = 0;
  return ret;
}
string s;
int poss[5010][5010];
int tot[5010];
int solve(int l, int r) {
  if (l > r)
    return 1;
  else if (l == r)
    return 1;
  else if (poss[l][r] != -1)
    return poss[l][r];
  int ret = (s[l] == s[r]) ? 1 : 0;
  ret = ret & solve(l + 2, r - 2);
  return (poss[l][r] = ret);
}
node* root;
void debug(node* a) {
  if (a == NULL) return;
  cerr << a->inSubtree << " D " << a->endingHere << endl;
}
int main() {
  root = newNode();
  cin >> s;
  for (int i = 0; i < 5010; i++) tot[i] = 0;
  for (int i = 0; i < 5010; i++)
    for (int j = 0; j < 5010; j++) poss[i][j] = -1;
  int aa = 0;
  for (int i = 0; i < (int)s.size(); i++) {
    for (int j = i; j < (int)s.size(); j++) {
      poss[i][j] = solve(i, j);
      tot[i] += poss[i][j];
    }
    aa += tot[i];
  }
  root->inSubtree = aa;
  for (int i = 0; i < (int)s.size(); i++) {
    node* temp = root;
    if (!tot[i]) continue;
    int j = i;
    while (j < (int)s.size() && tot[i]) {
      if (s[j] == 'a') {
        if (temp->left == NULL) temp->left = newNode();
        temp = temp->left;
        temp->inSubtree += tot[i];
        temp->endingHere += poss[i][j];
      } else {
        if (temp->right == NULL) temp->right = newNode();
        temp = temp->right;
        temp->inSubtree += tot[i];
        temp->endingHere += poss[i][j];
      }
      tot[i] -= poss[i][j];
      j += 1;
    }
  }
  int k;
  cin >> k;
  string ans = "";
  while (1) {
    node* L = root->left;
    node* R = root->right;
    k -= root->endingHere;
    if (k <= 0) {
      cout << ans << endl;
      return 0;
    } else if (root->left == NULL) {
      root = root->right;
      ans += "b";
    } else if (root->right == NULL) {
      root = root->left;
      ans += "a";
    } else if (L->inSubtree >= k) {
      ans += "a";
      root = root->left;
    } else {
      k -= L->inSubtree;
      ans += "b";
      root = root->right;
    }
  }
  return 0;
}
