#include <bits/stdc++.h>
using std::fill;
const int N = 222222;
int r[N], sa[N], X[N], Y[N], h[N], a[N], b[N];
bool cmp(int *r, int a, int b, int l) {
  return (r[a] == r[b] && r[a + l] == r[b + l]);
}
void suffix(int n, int m = 128) {
  int i, j, p, *x = X, *y = Y, *t;
  for (i = 0; i < m; i++) b[i] = 0;
  for (i = 0; i < n; i++) b[x[i] = a[i]]++;
  for (i = 1; i <= m - 1; i++) b[i] += b[i - 1];
  for (i = n - 1; i >= 0; i--) sa[--b[x[i]]] = i;
  for (j = 1, p = 1; p < n; m = p, j <<= 1) {
    p = 0;
    for (i = n - j; i <= n - 1; 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++) b[i] = 0;
    for (i = 0; i < n; i++) b[x[y[i]]]++;
    for (i = 1; i <= m - 1; i++) b[i] += b[i - 1];
    for (i = n - 1; i >= 0; i--) sa[--b[x[y[i]]]] = y[i];
    for (t = x, x = y, y = t, x[sa[0]] = 0, i = 1, p = 1; i < n; i++)
      x[sa[i]] = cmp(y, sa[i - 1], sa[i], j) ? p - 1 : p++;
  }
}
char s[N];
int extend[N];
int main() {
  int k;
  scanf("%s%d", s, &k);
  int n = strlen(s);
  if ((long long)n * (n - 1) / 2 + n < k) return puts("No such line."), 0;
  for (int i = 0; i < n; i++) a[i] = s[i];
  a[n] = 0;
  suffix(n + 1);
  int now = 1, ans = -1;
  for (;;) {
    if (sa[now] + extend[now] == n) now++;
    int i;
    k--;
    if (k == 0) {
      extend[now]++;
      ans = now;
      break;
    }
    for (i = now + 1; i <= n; i++) {
      if (extend[i] == extend[now] &&
          s[sa[i] + extend[i]] == s[sa[now] + extend[now]]) {
        k--;
        extend[i]++;
        if (k == 0) {
          ans = i;
          break;
        }
      } else {
        break;
      }
    }
    extend[now]++;
    if (ans != -1) break;
  }
  for (int i = sa[ans]; i < sa[ans] + extend[ans]; i++) printf("%c", s[i]);
  return 0;
}
