#include <bits/stdc++.h>
const int mxn = (int)1e5 + 5;
int r[mxn], wa[mxn], wb[mxn], ws[mxn], wv[mxn], sa[mxn];
char s[mxn];
int cmp(int r[], int a, int b, int l) {
  return r[a] == r[b] && r[a + l] == r[b + l];
}
void da(int n, int m) {
  r[n++] = 0;
  int i, j, p, *x = wa, *y = wb, *t;
  for (i = 0; i < m; i++) ws[i] = 0;
  for (i = 0; i < n; i++) ws[x[i] = r[i]]++;
  for (i = 1; i < m; i++) ws[i] += ws[i - 1];
  for (i = n - 1; i >= 0; i--) sa[--ws[x[i]]] = i;
  for (j = 1, p = 1; p < n; j *= 2, m = p) {
    for (p = 0, 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 < n; i++) wv[i] = x[y[i]];
    for (i = 0; i < m; i++) ws[i] = 0;
    for (i = 0; i < n; i++) ws[wv[i]]++;
    for (i = 1; i < m; i++) ws[i] += ws[i - 1];
    for (i = n - 1; i >= 0; i--) sa[--ws[wv[i]]] = y[i];
    for (t = x, x = y, y = t, p = 1, x[sa[0]] = 0, i = 1; i < n; i++) {
      x[sa[i]] = cmp(y, sa[i - 1], sa[i], j) ? p - 1 : p++;
    }
  }
}
int height[mxn], rank[mxn];
void calheight(int n) {
  int i, j, k = 0;
  for (i = 1; i <= n; i++) rank[sa[i]] = i;
  for (i = 0; i < n; height[rank[i++]] = k) {
    for (k ? k-- : 0, j = sa[rank[i] - 1]; r[i + k] == r[j + k]; k++)
      ;
  }
}
int tt[mxn];
int main() {
  int i, j, n, p, u, k;
  scanf("%s %d", s, &k);
  n = strlen(s);
  for (i = 0; s[i]; i++) r[i] = s[i];
  da(n, 255);
  calheight(n);
  for (i = 1; i <= n; i++) {
    p = sa[i];
    while (tt[i] + p < n) {
      j = i - 1;
      do {
        j++;
        tt[j]++;
        k--;
        if (k == 0) {
          for (u = sa[j]; u < sa[j] + tt[j]; u++) {
            putchar(s[u]);
          }
          return 0;
        }
      } while (height[j + 1] >= tt[i]);
    }
  }
  puts("No such line.");
}
