#include <bits/stdc++.h>
using namespace std;
string str;
int n, k;
bool dp[5003][5003];
struct node {
  int ch[2];
  int valid, sum;
  node() {
    memset(ch, -1, sizeof(ch));
    valid = sum = 0;
  }
};
vector<node> trie;
int init() {
  trie.push_back(node());
  return (int)trie.size() - 1;
}
void add(int x, int st, int now) {
  if (now == n + 1) {
    return;
  }
  int nxt = str[now] - 'a';
  if (trie[x].ch[nxt] == -1) {
    int tt = init();
    trie[x].ch[nxt] = tt;
  }
  if (dp[st][now]) {
    trie[trie[x].ch[nxt]].valid++;
  }
  add(trie[x].ch[nxt], st, now + 1);
}
int collect(int x) {
  trie[x].sum += trie[x].valid;
  for (int i = 0; i < 2; i++) {
    if (trie[x].ch[i] != -1) {
      trie[x].sum += collect(trie[x].ch[i]);
    }
  }
  return trie[x].sum;
}
string ans;
void go(int x) {
  if (k <= trie[x].valid) {
    cout << ans << endl;
    exit(0);
  }
  k -= trie[x].valid;
  if (trie[x].ch[0] != -1) {
    if (k <= trie[trie[x].ch[0]].sum) {
      ans += "a";
      go(trie[x].ch[0]);
    }
    k -= trie[trie[x].ch[0]].sum;
  }
  ans += "b";
  go(trie[x].ch[1]);
}
int main() {
  cin >> str;
  n = (int)str.size();
  str = "!" + str;
  scanf("%d", &k);
  init();
  for (int i = 1; i <= n; i++) {
    dp[i][i] = 1;
  }
  for (int len = 2; len <= n; len++) {
    for (int i = 1; i <= n; i++) {
      int j = i + len - 1;
      if (j > n || str[i] != str[j]) continue;
      if (i + 2 > j - 2)
        dp[i][j] = 1;
      else if (dp[i + 2][j - 2])
        dp[i][j] = 1;
    }
  }
  for (int i = 1; i <= n; i++) {
    add(0, i, i);
  }
  collect(0);
  go(0);
}
