#include <bits/stdc++.h>
using namespace std;
string s, ans = "";
int k;
int isPal[5001][5001];
struct node {
  int words;
  node* arr[2];
  node() {
    for (int i = 0; i < 2; ++i) {
      arr[i] = NULL;
    }
    words = 0;
  }
};
node* a = new node();
bool solve(int i, int j) {
  if (i >= j) return true;
  if (isPal[i][j] != -1) return isPal[i][j];
  isPal[i][j] = 0;
  if (s[i] != s[j]) {
    return isPal[i][j];
  } else
    return isPal[i][j] = solve(i + 2, j - 2);
}
bool find(node* v) {
  if (v == NULL) return false;
  k -= v->words;
  if (k <= 0) return true;
  if (find(v->arr[0])) {
    ans += "a";
    return true;
  }
  if (find(v->arr[1])) {
    ans += "b";
    return true;
  }
  return false;
}
int main() {
  memset(isPal, -1, sizeof(isPal));
  cin >> s;
  int x = s.size();
  for (int i = 0; i < x; i++) {
    node* z = a;
    for (int j = i; j < x; j++) {
      int index = s[j] - 'a';
      if (z->arr[index] == NULL) {
        z->arr[index] = new node();
      }
      z = z->arr[index];
      if (solve(i, j)) z->words++;
    }
  }
  cin >> k;
  find(a);
  reverse(ans.begin(), ans.end());
  cout << ans;
  return 0;
}
