#include <bits/stdc++.h>
using namespace std;
struct node {
  int l, r, p;
};
class compare {
 public:
  bool operator()(node f, node s) {
    if (f.l == s.l)
      return f.r < s.r;
    else
      return f.l < s.l;
  }
};
node ar[100010];
int sfx[20][100010], ole[100010];
string str;
void up() {
  int n = str.size(), x = 1, m;
  for (int i = 0; i <= n - 1; i++) sfx[0][i] = str[i];
  for (int j = 1; j <= 19; j++) {
    for (int i = 0; i <= n - 1; i++) {
      ar[i].l = sfx[j - 1][i];
      ar[i].r = -1;
      if (i + x < n) ar[i].r = sfx[j - 1][i + x];
      ar[i].p = i;
    }
    sort(ar, ar + n, compare());
    m = 0;
    for (int i = 0; i <= n - 1; i++) {
      if (i > 0) {
        if (!(ar[i].l == ar[i - 1].l && ar[i].r == ar[i - 1].r)) m++;
      }
      sfx[j][ar[i].p] = m;
    }
    x *= 2;
  }
}
int dp[5001][5001];
int rec(int p, int q) {
  if (p > q) return 1;
  if (str[p] != str[q]) return dp[p][q] = 0;
  if (dp[p][q] != -1) return dp[p][q];
  return dp[p][q] = rec(p + 2, q - 2);
}
int lcp(int f, int s, int t) {
  int n = str.size(), x = 1 << t;
  if (t == -1)
    return 0;
  else if (max(f + x, s + x) <= n && sfx[t][f] == sfx[t][s])
    return (1 << t) + lcp(f + (1 << t), s + (1 << t), t);
  else
    return lcp(f, s, t - 1);
}
int cnt[100010];
int main() {
  ios::sync_with_stdio(false);
  memset(dp, -1, sizeof(dp));
  int n, tt;
  cin >> str;
  n = str.size();
  up();
  cin >> tt;
  for (int i = 0; i <= n - 1; i++) {
    int p = ar[i].p, mo = n - p;
    for (int j = cnt[p] + 1; j <= mo; j++) {
      for (int k = i; k <= n - 1; k++) {
        int po = ar[k].p;
        if (lcp(p, po, 19) >= j) {
          if (rec(po, po + j - 1)) tt--;
          cnt[po]++;
          if (tt == 0) {
            for (int l = po; l <= po + cnt[po] - 1; l++) cout << str[l];
            cout << endl;
            return 0;
          }
        } else
          break;
      }
    }
  }
  cout << "No such line.";
  return 0;
}
