#include <bits/stdc++.h>
using namespace std;
int t1[(int)(1.1e5)], t2[(int)(1.1e5)], c[(int)(1.1e5)], srank[(int)(1.1e5)],
    height[(int)(1.1e5)], sa[(int)(1.1e5)];
bool cmp(int *r, int a, int b, int l) {
  return r[a] == r[b] && r[a + l] == r[b + l];
}
void DA(int str[], int n, int m) {
  n++;
  int i, j, p, *x = t1, *y = t2;
  for (i = 0; i < m; i++) c[i] = 0;
  for (i = 0; i < n; i++) c[x[i] = str[i]]++;
  for (i = 1; i < m; i++) c[i] += c[i - 1];
  for (i = n - 1; i >= 0; i--) sa[--c[x[i]]] = i;
  for (j = 1; j <= n; j <<= 1) {
    p = 0;
    for (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 < m; i++) c[i] = 0;
    for (i = 0; i < n; i++) c[x[y[i]]]++;
    for (i = 1; i < m; i++) c[i] += c[i - 1];
    for (i = n - 1; i >= 0; i--) sa[--c[x[y[i]]]] = y[i];
    swap(x, y);
    p = 1;
    x[sa[0]] = 0;
    for (i = 1; i < n; i++)
      x[sa[i]] = cmp(y, sa[i - 1], sa[i], j) ? p - 1 : p++;
    if (p >= n) break;
    m = p;
  }
  int k = 0;
  n--;
  for (i = 0; i <= n; i++) srank[sa[i]] = i;
  for (i = 0; i < n; i++) {
    if (k) k--;
    j = sa[srank[i] - 1];
    while (str[i + k] == str[j + k]) k++;
    height[srank[i]] = k;
  }
}
char s[(int)(1.1e5)];
int r[(int)(1.1e5)];
int main() {
  long long k, n;
  scanf("%s", s);
  scanf("%lld", &k);
  n = strlen(s);
  for (int i = 0; i < n; i++) r[i] = s[i] - 'a' + 1;
  DA(r, n, 30);
  long long tot = n * (n + 1) / 2;
  if (k > tot)
    cout << "No such line.\n";
  else {
    int row = 1, len = 0;
    while (k > 0) {
      len++;
      while (sa[row] + len == n + 1) {
        row++;
        len = height[row] + 1;
      }
      int count = row;
      while (count + 1 <= n && height[count + 1] >= len) count++;
      k -= count - row + 1;
    }
    for (int i = sa[row]; i <= sa[row] + len - 1; i++) putchar(s[i]);
    putchar('\n');
  }
  return 0;
}
