#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:100000000")
using namespace std;
char s[100100];
int n, m[100100], b[2][2 * 100100], p[100100], c[100100], h, f;
bool f1(int i, int j) { return s[i] < s[j]; }
bool f2(int i, int j) {
  return b[f ^ 1][i] < b[f ^ 1][j] ||
         (b[f ^ 1][i] == b[f ^ 1][j] && b[f ^ 1][i + h] < b[f ^ 1][j + h]);
}
void F(bool x(int i, int j)) {
  int i;
  for (sort(m, m + n, x), b[f][m[0]] = 1, i = 1; i < n;
       b[f][m[i]] = b[f][m[i - 1]] + x(m[i - 1], m[i]), i++)
    ;
}
void sfa() {
  for (F(f1), h = 1; b[f][m[n - 1]] < n; f ^= 1, F(f2), h *= 2)
    ;
}
void lcp() {
  int i, j;
  for (i = 0; i < n; p[m[i]] = i, i++)
    ;
  for (j = 0, i = 0; i < n; c[p[i]] = j, i++)
    if (p[i] < n - 1)
      for (j -= j > 0; s[i + j] == s[m[p[i] + 1] + j]; j++)
        ;
    else
      j = 0;
}
bool rec(int b, int v, int &k) {
  int i;
  if (s[m[b] + v] == 0) {
    if (c[b] > v - 1)
      return rec(b + 1, v, k);
    else
      return 0;
  }
  if (k == 0) {
    f = m[b];
    h = v + 1;
    return 1;
  }
  k--;
  for (i = 1; b + i < n && c[b + i - 1] > v; k--, i++)
    if (!k) {
      f = m[b + i];
      h = v + 1;
      return 1;
    }
  if (rec(b, v + 1, k))
    return 1;
  else if (c[b + i - 1] > v - 1)
    return rec(b + i, v, k);
  else
    return 0;
}
int main() {
  int k;
  for (scanf("%s%d", s, &k), n = 0; s[n]; m[n] = n, n++)
    ;
  k--;
  if (k >= (long long)n * (n + 1) / 2)
    printf("No such line.\n");
  else {
    sfa();
    lcp();
    rec(0, 0, k);
    s[f + h] = 0;
    printf("%s\n", s + f);
  }
  return 0;
}
