#include <bits/stdc++.h>
using namespace std;
long long int fastMax(long long int x, long long int y) {
  return (((y - x) >> (32 - 1)) & (x ^ y)) ^ y;
}
long long int fastMin(long long int x, long long int y) {
  return (((y - x) >> (32 - 1)) & (x ^ y)) ^ x;
}
const long long int MAXN = 5005;
long long int n, k;
string second;
bool dp[MAXN][MAXN];
void prep() {
  for (long long int len = (1); len <= (n); ++len) {
    for (long long int i = 0; i <= n - len; i++) {
      long long int j = i + len - 1;
      if (len <= 4)
        dp[i][j] = second[i] == second[j];
      else
        dp[i][j] = (second[i] == second[j] && dp[i + 2][j - 2]);
    }
  }
}
struct Trie {
  struct trienode {
    trienode *child[2] = {NULL, NULL};
    bool endd = false;
    long long int cnt = 0, sum = 0;
  };
  trienode *troot = new trienode;
  void insert(long long int i) {
    trienode *curr = troot;
    long long int j = i;
    while (j < n) {
      if (!(curr->child[second[j] - 'a']))
        curr->child[second[j] - 'a'] = new trienode;
      curr = curr->child[second[j] - 'a'];
      curr->cnt += dp[i][j];
      j++;
    }
    curr->endd = 1;
  }
  long long int cnt(trienode *root) { return root ? root->cnt : 0; }
  long long int sum(trienode *root) { return root ? root->sum : 0; }
  long long int dfs(trienode *curr) {
    if (!curr) return 0;
    curr->sum = curr->cnt;
    curr->sum += dfs(curr->child[0]);
    curr->sum += dfs(curr->child[1]);
    return curr->sum;
  }
  long long int dfs() { return dfs(troot); }
  string query(long long int k) {
    trienode *curr = troot;
    string ans;
    while (k > 0) {
      long long int x = sum(curr->child[0]);
      if (x >= k) {
        ans += 'a';
        curr = curr->child[0];
      } else {
        ans += 'b';
        k -= x;
        curr = curr->child[1];
      }
      k -= cnt(curr);
    }
    return ans;
  }
};
void solve() {
  cin >> second >> k;
  n = (long long int)second.size();
  prep();
  Trie T;
  for (long long int i = (0); i <= (n - 1); ++i) T.insert(i);
  T.dfs();
  cout << T.query(k) << '\n';
}
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long int t = 1;
  for (long long int i = (1); i <= (t); ++i) {
    solve();
  }
}
