#include <bits/stdc++.h>
using namespace std;
template <class A, class B>
inline bool mina(A &x, const B &y) {
  return (y < x) ? (x = y, 1) : 0;
}
template <class A, class B>
inline bool maxa(A &x, const B &y) {
  return (x < y) ? (x = y, 1) : 0;
}
string S;
int K, N;
bitset<(5005)> dp[(5005)];
string sol;
class Trie {
 public:
  int mark;
  Trie *A[2];
  Trie() {
    mark = 0;
    A[0] = A[1] = 0;
  }
  inline Trie *get(int id, int b = 0) {
    Trie *&t = A[id];
    if (b && !t) t = new Trie();
    return t;
  }
  void add(int l, int p) {
    if (p < N) get(S[p] - 'a', 1)->add(l, p + 1);
    if (l != p && dp[l][p - 1]) ++mark;
  }
  void dfs() {
    K -= mark;
    if (K <= 0) {
      cout << sol << '\n';
      exit(0);
    }
    for (int _b = (2), i = (0); i < _b; ++i)
      if (A[i]) {
        sol.push_back(i + 'a');
        A[i]->dfs();
        sol.pop_back();
      }
  }
};
int main() {
  {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
  };
  cin >> S >> K;
  N = int((S).size());
  for (int _b = (N + 1), n = (1); n < _b; ++n)
    for (int _b = (N - n + 1), l = (0); l < _b; ++l) {
      int r = l + n - 1;
      if (n <= 4)
        dp[l][r] = S[l] == S[r];
      else
        dp[l][r] = (S[l] == S[r]) && dp[l + 2][r - 2];
    }
  Trie T;
  for (int _b = (N), i = (0); i < _b; ++i) T.add(i, i);
  T.dfs();
  return 0;
}
