#include <bits/stdc++.h>
using namespace std;
struct SAComp {
  const int h, *g;
  SAComp(int h, int *g) : h(h), g(g) {}
  bool operator()(int a, int b) {
    return a == b ? false : g[a] != g[b] ? g[a] < g[b] : g[a + h] < g[b + h];
  }
};
int *buildSA(string &t) {
  int n = (int)((t).size());
  int g[n + 1], b[n + 1], *v = new int[n + 1];
  for (int i = 0; i < (int)(n + 1); ++i) v[i] = i, g[i] = t[i];
  b[0] = 0;
  b[n] = 0;
  sort(v, v + n + 1, SAComp(0, g));
  for (int h = 1; b[n] != n; h *= 2) {
    SAComp comp(h, g);
    sort(v, v + n + 1, comp);
    for (int i = 0; i < (int)(n); ++i) b[i + 1] = b[i] + comp(v[i], v[i + 1]);
    for (int i = 0; i < (int)(n + 1); ++i) g[v[i]] = b[i];
  }
  return v;
}
int *buildLCP(string &t, int *a) {
  int n = (int)((t).size());
  int h = 0, b[n + 1], *lcp = new int[n + 1];
  for (int i = 0; i < (int)(n + 1); ++i) b[a[i]] = i;
  for (int i = 0; i < (int)(n + 1); ++i) {
    if (b[i]) {
      for (int j = a[b[i] - 1]; j + h < n && i + h < n && t[j + h] == t[i + h];
           ++h)
        ;
      lcp[b[i]] = h;
    } else
      lcp[b[i]] = -1;
    if (h > 0) --h;
  }
  return lcp;
}
int pred[100020];
char temp[100020];
int main() {
  while (scanf(" %s", temp) != EOF) {
    string s(temp);
    int N = (int)((s).size());
    int K;
    scanf("%d", &K);
    int *v = buildSA(s);
    int *lcp = buildLCP(s, v);
    memset((pred), (0), sizeof(pred));
    for (int i = (1); i <= (int)(N); ++i) {
      for (int k = (pred[i] + 1); k <= (int)(N - v[i]); ++k) {
        for (int j = i; j <= N; ++j) {
          if (j > i && lcp[j] < k) break;
          pred[j] = k;
          K--;
          if (K == 0) {
            printf("%s\n", s.substr(v[i], k).c_str());
            goto SKIPPP;
          }
        }
      }
    }
    puts("No such line.");
  SKIPPP:;
  }
}
