#include <bits/stdc++.h>
using namespace std;
char s[200000];
int a[200000];
int b[200000];
int c[200000];
int n, l, k, f;
bool pr1(int i, int j) { return s[i] < s[j]; }
bool pr2(int i, int j) {
  if (i + l >= n) return 1;
  if (j + l >= n) return 0;
  return b[i + l] < b[j + l];
}
void rec(int l, int r, int z) {
  if (f) return;
  if (z && !s[a[l] + z - 1]) return;
  int c, i;
  int ll = l;
  int rr = r;
  while (l < r) {
    c = (l + r + 1) / 2;
    if (s[a[c] + z] == s[a[ll] + z])
      l = c;
    else
      r = c - 1;
  }
  c = l;
  l = ll;
  r = rr;
  if (k <= c - l && s[a[l] + z]) {
    for (i = 0; i <= z; i++) printf("%c", s[a[l] + i]);
    printf("\n");
    f = 1;
    return;
  }
  if (s[a[l] + z]) k -= c - l + 1;
  rec(l, c, z + 1);
  if (c + 1 <= r) rec(c + 1, r, z);
}
int main() {
  int i, j;
  scanf("%s%d", &s, &k);
  k--;
  n = strlen(s);
  if ((long long)n * (n + 1) / 2 <= k) {
    printf("No such line.\n");
    return 0;
  }
  for (i = 0; i < n; i++) a[i] = i;
  sort(a, a + n, pr1);
  b[a[0]] = 1;
  for (i = 1; i < n; i++) b[a[i]] = b[a[i - 1]] + pr1(a[i - 1], a[i]);
  for (l = 1; l < n; l += l) {
    j = 0;
    for (i = 0; i < n; i++)
      if (b[a[i]] != b[a[j]]) {
        sort(a + j, a + i, pr2);
        c[a[j]] = j ? c[a[j - 1]] + 1 : 1;
        for (j++; j < i; j++) c[a[j]] = c[a[j - 1]] + pr2(a[j - 1], a[j]);
      }
    sort(a + j, a + n, pr2);
    c[a[j]] = j ? c[a[j - 1]] + 1 : 1;
    for (j++; j < n; j++) c[a[j]] = c[a[j - 1]] + pr2(a[j - 1], a[j]);
    for (i = 0; i < n; i++) b[i] = c[i];
  }
  rec(0, n - 1, 0);
  return 0;
}
