#include <bits/stdc++.h>
int dr[] = {2, 2, -2, -2, 1, -1, 1, -1};
int dc[] = {1, -1, 1, -1, 2, 2, -2, -2};
int dr1[] = {0, 0, 1, 1, 1, -1, -1, -1};
int dc1[] = {1, -1, 1, 0, -1, 0, 1, -1};
int dr2[] = {0, 0, 1, -1};
int dc2[] = {1, -1, 0, 0};
using namespace std;
long long int dp[5005][5005];
string t;
long long int cal(long long int x, long long int y) {
  if (y <= x) return 1;
  long long int &r = dp[x][y];
  if (r != -1) return r;
  r = 0;
  if (t[x] == t[y]) r = cal(x + 2, y - 2);
  return r;
}
long long int pos[10005], sa[10005], gap, n, tmp[10005], lcp[10005];
bool sufcmp(long long int i, long long int j) {
  if (pos[i] != pos[j]) return pos[i] < pos[j];
  i += gap;
  j += gap;
  return (i < n && j < n) ? pos[i] < pos[j] : i > j;
}
void buildsa() {
  n = t.size();
  long long int i;
  for (i = 0; i < n; i++) sa[i] = i, pos[i] = t[i];
  for (gap = 1; gap <= n; gap *= 2) {
    sort(sa, sa + n, sufcmp);
    for (i = 0; i + 1 < n; i++) tmp[i + 1] = tmp[i] + sufcmp(sa[i], sa[i + 1]);
    for (i = 0; i < n; i++) pos[sa[i]] = tmp[i];
    if (tmp[n - 1] == n - 1) break;
  }
}
void lcp1() {
  long long int i, j, k;
  for (i = 0, k = 0; i < n; ++i, k ? k-- : 0) {
    if (pos[i] == n - 1) continue;
    j = sa[pos[i] + 1];
    while (i + k < n && j + k < n && t[i + k] == t[j + k]) k++;
    lcp[pos[i]] = k;
  }
}
long long int siz, last;
vector<long long int> adj[300005];
long long int occ[300005];
struct automata {
  long long int len, link, next[4];
} st[300005];
void inser(char c) {
  long long int now = ++siz;
  st[now].len = st[last].len + 1;
  long long int p, q, cl;
  occ[now] = 1;
  for (p = last; p != -1 && !st[p].next[c]; p = st[p].link) st[p].next[c] = now;
  if (p == -1)
    st[now].link = 0;
  else {
    q = st[p].next[c];
    if (st[p].len + 1 == st[q].len)
      st[now].link = q;
    else {
      cl = ++siz, st[cl].len = st[p].len + 1;
      st[cl].link = st[q].link;
      memcpy(st[cl].next, st[q].next, sizeof(st[cl].next));
      for (; p != -1 && st[p].next[c] == q; p = st[p].link) st[p].next[c] = cl;
      st[now].link = st[q].link = cl;
    }
  }
  last = now;
}
void process() {
  long long int i, j;
  for (i = 1; i <= siz; i++) {
    long long int p = st[i].len;
    adj[p].push_back(i);
  }
  for (i = n; i >= 1; i--) {
    for (j = 0; j < adj[i].size(); j++) {
      long long int node = adj[i][j];
      long long int par = st[node].link;
      occ[par] += occ[node];
    }
  }
}
void build1() {
  long long int i, j;
  st[0].link = -1;
  for (i = 0; i < n; i++) inser(t[i] - 'a');
  process();
}
int main() {
  long long int i, j, k;
  long long int s = 0;
  while (cin >> t) {
    cin >> k;
    memset(dp, -1, sizeof(dp));
    long long int ans = 0;
    n = t.size();
    long long int len = -1;
    for (i = 1; i <= n; i++) {
      for (j = 0; j + i - 1 < n; j++) cal(j, i + j - 1);
    }
    buildsa();
    lcp1();
    build1();
    long long int pre = 0;
    long long int ans1, ans2;
    for (i = 0; i < n; i++) {
      long long int st1 = sa[i] + pre;
      pre = lcp[i];
      long long int now = 0;
      for (j = sa[i]; j < n; j++) {
        long long int r = t[j] - 'a';
        now = st[now].next[r];
        if (j >= st1) {
          long long int x = cal(sa[i], j);
          if (x == 1) k -= occ[now];
          if (k <= 0) {
            ans1 = sa[i], ans2 = j;
            break;
          }
        }
      }
      if (k <= 0) break;
    }
    for (i = ans1; i <= ans2; i++) cout << t[i];
    cout << endl;
  }
  return 0;
}
