#include <bits/stdc++.h>
using namespace std;
int sa[100000 + 5], Rank[100000 + 5], Height[100000 + 5], tax[100000 + 5],
    tp[100000 + 5], ptr[100000 + 5];
char str[100000 + 5];
void RSort(int n, int m) {
  int i;
  for (i = 0; i <= m; i++) tax[i] = 0;
  for (i = 1; i <= n; i++) tax[Rank[tp[i]]]++;
  for (i = 1; i <= m; i++) tax[i] += tax[i - 1];
  for (i = n; i >= 1; i--) sa[tax[Rank[tp[i]]]--] = tp[i];
}
bool cmp(int *f, int x, int y, int w) {
  return f[x] == f[y] && f[x + w] == f[y + w];
}
void arr_swap(int *a, int *b, int n) {
  int i;
  for (i = 1; i <= n; i++) swap(a[i], b[i]);
  return;
}
void Suffix(char *a, int n, int m) {
  int i, j, p, k = 0;
  for (i = 1; i <= n; i++) Rank[i] = a[i];
  for (i = 1; i <= n; i++) tp[i] = i;
  RSort(n, m);
  for (j = 1, p = 1; p < n; j <<= 1, m = p) {
    p = 0;
    for (i = n - j + 1; i <= n; i++) tp[++p] = i;
    for (i = 1; i <= n; i++)
      if (sa[i] > j) tp[++p] = sa[i] - j;
    RSort(n, m);
    arr_swap(Rank, tp, n);
    Rank[sa[1]] = p = 1;
    for (i = 2; i <= n; i++)
      Rank[sa[i]] = cmp(tp, sa[i], sa[i - 1], j) ? p : ++p;
  }
  for (i = 1; i <= n; Height[Rank[i++]] = k)
    for (k = k ? k - 1 : k, j = sa[Rank[i] - 1]; a[i + k] == a[j + k]; k++)
      ;
}
int main() {
  int k;
  scanf("%s%d", str, &k);
  int n = strlen(str);
  Suffix(str - 1, n, 127);
  bool flag = 0;
  if (n <= 10000 && n * (n + 1) / 2 < k) {
    printf("No such line.\n");
    return 0;
  }
  int cnt = 0, i, j;
  for (i = 1; i <= n; i++) {
    while (ptr[i] < n - sa[i] + 1) {
      for (j = i; j <= n; j++) {
        cnt++;
        ptr[j]++;
        if (cnt == k) {
          flag = 1;
          break;
        }
        if (Height[j + 1] < ptr[i]) break;
      }
      if (flag) break;
    }
    if (flag) break;
  }
  str[sa[j] + ptr[j] - 1] = 0;
  printf("%s\n", str + sa[j] - 1);
  return 0;
}
