#include <bits/stdc++.h>
using namespace std;
template <typename T>
T in() {
  char ch;
  T n = 0;
  bool ng = false;
  while (1) {
    ch = getchar();
    if (ch == '-') {
      ng = true;
      ch = getchar();
      break;
    }
    if (ch >= '0' && ch <= '9') break;
  }
  while (1) {
    n = n * 10 + (ch - '0');
    ch = getchar();
    if (ch < '0' || ch > '9') break;
  }
  return (ng ? -n : n);
}
template <typename T>
inline T Dist(T x1, T y1, T x2, T y2) {
  return sqrt((x1 - x2 * x1 - x2) + (y1 - y2 * y1 - y2));
}
template <typename T>
inline T POW(T B, T P) {
  if (P == 0) return 1;
  if (P & 1)
    return B * POW(B, P - 1);
  else
    return (POW(B, P / 2) * POW(B, P / 2));
}
template <typename T>
inline T ABS(T a) {
  if (a < 0)
    return -a;
  else
    return a;
}
template <typename T>
inline T Gcd(T a, T b) {
  if (a < 0) return Gcd(-a, b);
  if (b < 0) return Gcd(a, -b);
  return (b == 0) ? a : Gcd(b, a % b);
}
template <typename T>
inline T Lcm(T a, T b) {
  if (a < 0) return Lcm(-a, b);
  if (b < 0) return Lcm(a, -b);
  return a * (b / Gcd(a, b));
}
long long Bigmod(long long base, long long power, long long MOD) {
  long long ret = 1;
  while (power) {
    if (power & 1) ret = (ret * base) % MOD;
    base = (base * base) % MOD;
    power >>= 1;
  }
  return ret;
}
long long ModInverse(long long number, long long MOD) {
  return Bigmod(number, MOD - 2, MOD);
}
int Set(int N, int pos) { return N = N | (1 << pos); }
int Reset(int N, int pos) { return N = N & ~(1 << pos); }
bool Chkbit(int N, int pos) { return (bool)(N & (1 << pos)); }
bool isVowel(char ch) {
  ch = toupper(ch);
  if (ch == 'A' || ch == 'U' || ch == 'I' || ch == 'O' || ch == 'E')
    return true;
  return false;
}
bool isConst(char ch) {
  if (isalpha(ch) && !isVowel(ch)) return true;
  return false;
}
int toInt(string s) {
  int sm;
  stringstream ss(s);
  ss >> sm;
  return sm;
}
long long int toLlint(string s) {
  long long int sm;
  stringstream ss(s);
  ss >> sm;
  return sm;
}
const int N = int(1e4) + 10;
int cmp(int *r, int a, int b, int l) {
  return (r[a] == r[b]) && (r[a + l] == r[b + l]);
}
int wa[N], wb[N], wws[N], wv[N];
int rnk[N], height[N];
void DA(int *r, int *sa, int n, int m) {
  int i, j, p, *x = wa, *y = wb, *t;
  for (i = 0; i < m; i++) wws[i] = 0;
  for (i = 0; i < n; i++) wws[x[i] = r[i]]++;
  for (i = 1; i < m; i++) wws[i] += wws[i - 1];
  for (i = n - 1; i >= 0; i--) sa[--wws[x[i]]] = i;
  for (j = 1, p = 1; p < n; j *= 2, m = p) {
    for (p = 0, i = n - j; i < n; i++) y[p++] = i;
    for (i = 0; i < n; i++)
      if (sa[i] >= j) y[p++] = sa[i] - j;
    for (i = 0; i < n; i++) wv[i] = x[y[i]];
    for (i = 0; i < m; i++) wws[i] = 0;
    for (i = 0; i < n; i++) wws[wv[i]]++;
    for (i = 1; i < m; i++) wws[i] += wws[i - 1];
    for (i = n - 1; i >= 0; i--) sa[--wws[wv[i]]] = y[i];
    for (t = x, x = y, y = t, p = 1, x[sa[0]] = 0, i = 1; i < n; i++)
      x[sa[i]] = cmp(y, sa[i - 1], sa[i], j) ? p - 1 : p++;
  }
}
void calheight(int *r, int *sa, int n) {
  int i, j, k = 0;
  for (i = 1; i <= n; i++) rnk[sa[i]] = i;
  for (i = 0; i < n; height[rnk[i++]] = k)
    for (k ? k-- : 0, j = sa[rnk[i] - 1]; r[i + k] == r[j + k]; k++)
      ;
}
int sa[N], data[N], n, p, q;
void Deal() {
  DA(data, sa, n + 1, 128);
  calheight(data, sa, n);
}
int dp[20][5005];
void Sparse() {
  for (int i = 0; i < n; i++) dp[0][i] = height[i + 1];
  for (int i = 1; (1 << i) <= n; i++) {
    for (int j = 0; j + (1 << i) - 1 < n; j++) {
      if (dp[i - 1][j] < dp[i - 1][j + (1 << (i - 1))])
        dp[i][j] = dp[i - 1][j];
      else
        dp[i][j] = dp[i - 1][j + (1 << (i - 1))];
    }
  }
}
int Quey(int xx, int yy) {
  xx--;
  yy--;
  int diff = 31 - __builtin_clz(yy - xx + 1);
  return (dp[diff][xx] < dp[diff][yy - (1 << diff) + 1]
              ? dp[diff][xx]
              : dp[diff][yy - (1 << diff) + 1]);
}
int Query(int l, int r, int val) {
  int lw = l, hg = r, ans;
  while (lw <= hg) {
    int mid = (lw + hg) >> 1;
    if (Quey(lw, mid) < val)
      hg = mid - 1;
    else {
      ans = mid;
      lw = mid + 1;
    }
  }
  return ans;
}
int ok[5005][5005];
int ar[5005];
string s;
void Process(int pos, int len) {
  int st = sa[pos], ed = st + len;
  for (int i = st; i < ed; i++) cout << s[i];
  return;
}
int main() {
  cin >> s;
  n = s.size();
  for (int i = 1; i < n + 1; i++) {
    ar[i] = (int)(s[i - 1]);
  }
  for (int i = 1; i <= n; i++) {
    ok[i][i] = 1;
    if (s[i - 1] == s[i]) ok[i][i + 1] = 1;
  }
  for (int i = 3; i <= n; i++) {
    for (int j = 1; (j + i - 1) <= n; j++) {
      int lft = j, rgt = j + i - 1;
      int c = lft + 2;
      int d = rgt - 2;
      if (ar[lft] == ar[rgt]) {
        if (d <= c || ok[c][d]) {
          ok[lft][rgt] = 1;
        }
      }
    }
  }
  n = 0;
  for (; s[n] != '\0'; n++) {
    data[n] = (int)(s[n] - 'a') + 1;
  }
  data[n] = 0;
  Deal();
  long long int k;
  Sparse();
  k = in<long long int>();
  for (int i = 1; i <= n; i++) {
    int tp = sa[i] + 1;
    int lcp = height[i];
    for (int j = tp + lcp; j <= n; j++) {
      if (ok[tp][j]) {
        int nxt = i;
        if (i < n && height[i + 1] >= (j - tp + 1))
          nxt = Query(i + 1, n, j - tp + 1);
        nxt = nxt - i + 1;
        if (nxt >= k) {
          Process(i + k - 1, j - tp + 1);
          return 0;
        } else
          k -= nxt;
      }
    }
  }
  return 0;
}
