#include <bits/stdc++.h>
using namespace std;
char st[100010];
int sarr[100010], rarr[100010], tempsarr[100010], temprarr[100010],
    counting[100010];
int n;
void rsort(int k) {
  int mxr = max(260, n);
  memset(counting, 0, sizeof counting);
  for (int i = 0; i < n; i++) {
    counting[i + k < n ? rarr[i + k] : 0]++;
  }
  int sum = 0;
  for (int i = 0; i < mxr; i++) {
    int temp = counting[i];
    counting[i] = sum;
    sum += temp;
  }
  for (int i = 0; i < n; i++) {
    tempsarr[counting[sarr[i] + k < n ? rarr[sarr[i] + k] : 0]++] = sarr[i];
  }
  for (int i = 0; i < n; i++) {
    sarr[i] = tempsarr[i];
  }
}
void build() {
  for (int i = 0; i < n; i++) {
    sarr[i] = i;
    rarr[i] = st[i];
  }
  for (int k = 1; k < n; k <<= 1) {
    rsort(k);
    rsort(0);
    int rank;
    temprarr[sarr[0]] = rank = 0;
    for (int i = 1; i < n; i++)
      temprarr[sarr[i]] = (rarr[sarr[i - 1]] == rarr[sarr[i]] &&
                           rarr[sarr[i - 1] + k] == rarr[sarr[i] + k])
                              ? rank
                              : ++rank;
    for (int i = 0; i < n; i++) rarr[i] = temprarr[i];
    if (rarr[sarr[n - 1]] == n - 1) break;
  }
}
int lcp[100010], plcp[100010], phi[100010];
void computelcp() {
  phi[sarr[0]] = -1;
  for (int i = 1; i < n; i++) phi[sarr[i]] = sarr[i - 1];
  int l = 0;
  for (int i = 0; i < n; i++) {
    if (phi[i] == -1) {
      plcp[i] = 0;
      continue;
    }
    while (st[i + l] == st[phi[i] + l]) l++;
    plcp[i] = l;
    l = max(l - 1, 0);
  }
  for (int i = 0; i < n; i++) lcp[i] = plcp[sarr[i]];
}
long long int pre_sum[100010];
int a[100010];
int main() {
  long long int k, j, i;
  scanf(" %[^\n]", st);
  n = strlen(st);
  st[n++] = '$';
  build();
  computelcp();
  for (int i = 0; i < n; i++) {
    sarr[i] = sarr[i + 1];
    lcp[i] = lcp[i + 1];
  }
  n--;
  scanf("%lld", &k);
  for (i = 0; i < n; i++) {
    a[i + 1] = lcp[i + 1];
    for (j = i + 2; j < n; j++) {
      a[j] = min(a[j - 1], lcp[j]);
    }
    int q = n - 1, p = sarr[i];
    for (j = p + lcp[i]; j < n; j++) {
      while (q > i) {
        if (a[q] >= j - p + 1) break;
        q--;
      }
      k -= ((q - i + 1));
      if (k <= 0) {
        for (k = p; k <= j; k++) printf("%c", st[k]);
        return 0;
      }
    }
  }
  printf("No such line.\n");
}
