#include <bits/stdc++.h>
using namespace std;
int bucket[CHAR_MAX - CHAR_MIN + 1];
int prm[100000], cnt[100000];
char bh[100000 + 1];
void bsa(char *str, int *sarray, int *lcp) {
  int n, a, c, d, e, f, h, i, j, x;
  n = strlen(str);
  memset(bucket, -1, sizeof(bucket));
  for (i = 0; i < n; i++) {
    j = str[i] - CHAR_MIN;
    prm[i] = bucket[j];
    bucket[j] = i;
  }
  for (a = c = 0; a <= CHAR_MAX - CHAR_MIN; a++)
    for (i = bucket[a]; i != -1; i = j) {
      j = prm[i];
      prm[i] = c;
      bh[c++] = (i == bucket[a]);
    }
  bh[n] = 1;
  for (i = 0; i < n; i++) sarray[prm[i]] = i;
  x = 0;
  for (h = 1; h < n; h *= 2) {
    for (i = 0; i < n; i++) {
      if (bh[i] & 1) {
        x = i;
        cnt[x] = 0;
      }
      prm[sarray[i]] = x;
    }
    d = n - h;
    e = prm[d];
    prm[d] = e + cnt[e];
    cnt[e]++;
    bh[prm[d]] |= 2;
    i = 0;
    while (i < n) {
      for (j = i; (j == i || !(bh[j] & 1)) && j < n; j++) {
        d = sarray[j] - h;
        if (d >= 0) {
          e = prm[d];
          prm[d] = e + cnt[e];
          cnt[e]++;
          bh[prm[d]] |= 2;
        }
      }
      for (j = i; (j == i || !(bh[j] & 1)) && j < n; j++) {
        d = sarray[j] - h;
        if (d >= 0 && bh[prm[d]] & 2) {
          for (e = prm[d] + 1; bh[e] == 2; e++)
            ;
          for (f = prm[d] + 1; f < e; f++) bh[f] &= 1;
        }
      }
      i = j;
    }
    for (i = 0; i < n; i++) {
      sarray[prm[i]] = i;
      if (bh[i] == 2) bh[i] = 3;
    }
  }
  h = 0;
  for (i = 0; i < n; i++) {
    e = prm[i];
    if (e > 0) {
      j = sarray[e - 1];
      while (str[i + h] == str[j + h]) h++;
      lcp[e] = h;
      if (h > 0) h--;
    }
  }
  lcp[0] = 0;
}
const int N = 1e5 + 7;
int k;
char s[N];
int sa[N], lcp[N];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0), cout.tie(0);
  cin >> s >> k;
  int n = strlen(s);
  if (1ll * n * (n + 1) < 1ll * (k << 1)) {
    cout << "No such line.\n";
    return 0;
  }
  bsa(s, sa, lcp);
  --k;
  int h = 1, x = 0, st = 0;
  while (k || h > n - sa[x]) {
    if (h > n - sa[x]) {
      h = lcp[x + 1] + 1;
      ++x;
      ++st;
      continue;
    }
    if (h > lcp[x + 1]) {
      ++h;
      x = st;
    } else
      ++x;
    --k;
  }
  for (int i = sa[x], j = 0; j < h; ++j, ++i) cout << s[i];
  return 0;
}
