#include <bits/stdc++.h>
const long long md = 1e9 + 7;
const int Inf = 1e9;
const long long Inf64 = 1e18;
const long long MaxN = 1e5 + 10;
const long long LogN = 20;
const long long MaxM = 1e10;
const long double eps = 1e-7;
const long long dx[4] = {0, 1, 0, -1};
const long long dy[4] = {1, 0, -1, 0};
const long long ddx[4] = {1, 1, -1, -1};
const long long ddy[4] = {1, -1, 1, -1};
const long double Pi = acos(-1);
using namespace std;
inline long long Mod(long long &a, long long m = md) {
  while (a > m) a -= m;
  return a;
}
inline long long gcd(long long a, long long b) {
  while (a) {
    b %= a;
    swap(a, b);
  }
  return b;
}
inline long long gcdex(long long a, long long mod = md) {
  long long g = mod, r = a, x = 0, y = 1;
  while (r != 0) {
    long long q = g / r;
    g %= r;
    swap(g, r);
    x -= q * y;
    swap(x, y);
  }
  return x < 0 ? x + mod : x;
}
inline long long binpow(long long a, long long n, long long m = md) {
  long long res = 1;
  while (n) {
    if (n & 1) {
      res *= a;
      res %= m;
    }
    a *= a;
    a %= m;
    n >>= 1;
  }
  return res % md;
}
long long alf = 27;
long long Cnt[MaxN];
long long p[MaxN];
long long c[LogN][MaxN];
long long pn[MaxN];
long long cn[MaxN];
long long lcp[MaxN];
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  string s;
  cin >> s;
  char C = 'a' - 1;
  s.push_back(C);
  long long N = s.size();
  memset(Cnt, 0, alf * sizeof(long long));
  for (int i = 0; i < N; i++) {
    Cnt[s[i] - C]++;
  }
  for (int i = 1; i < alf; i++) {
    Cnt[i] += Cnt[i - 1];
  }
  for (int i = 0; i < N; i++) {
    p[--Cnt[s[i] - C]] = i;
  }
  c[0][p[0]] = 0;
  long long classes = 1;
  for (int i = 1; i < N; i++) {
    if (s[p[i]] != s[p[i - 1]]) classes++;
    c[0][p[i]] = classes - 1;
  }
  long long lg = 0;
  for (int k = 0; (1 << k) < N; k++) {
    for (int i = 0; i < N; i++) {
      pn[i] = p[i] - (1 << k);
      if (pn[i] < 0) pn[i] += N;
    }
    memset(Cnt, 0, classes * sizeof(long long));
    for (int i = 0; i < N; i++) {
      Cnt[c[k][pn[i]]]++;
    }
    for (int i = 1; i < classes; i++) {
      Cnt[i] += Cnt[i - 1];
    }
    for (int i = N - 1; i >= 0; --i) {
      p[--Cnt[c[k][pn[i]]]] = pn[i];
    }
    cn[p[0]] = 0;
    classes = 1;
    for (int i = 1; i < N; i++) {
      long long mid1 = (p[i] + (1 << k)) % N;
      long long mid2 = (p[i - 1] + (1 << k)) % N;
      if (c[k][p[i]] != c[k][p[i - 1]] || c[k][mid1] != c[k][mid2]) classes++;
      cn[p[i]] = classes - 1;
    }
    memcpy(c[k + 1], cn, N * sizeof(long long));
    lg = k + 1;
  }
  for (int i = 0; i < N - 1; i++) {
    long long f = p[i], s = p[i + 1];
    lcp[i] = 0;
    for (int j = lg; j >= 0; j--) {
      if (c[j][f] == c[j][s]) {
        lcp[i] += 1 << j;
        f += 1 << j;
        s += 1 << j;
      }
    }
  }
  long long K;
  cin >> K;
  if (K > N * (N - 1) / 2) {
    cout << "No such line.";
    return 0;
  }
  --K;
  long long len = 1, beg = 1, pos = 1;
  while (K || len >= N - p[pos]) {
    if (len >= N - p[pos]) {
      len = lcp[pos] + 1;
      ++beg;
      ++pos;
      continue;
    }
    if (lcp[pos] < len) {
      ++len;
      pos = beg;
    } else {
      ++pos;
    }
    --K;
  }
  for (int i = p[pos], j = 0; j < len; ++j, ++i) {
    cout << (s[i]);
  }
  cerr << '\n'
       << "Time execute: " << clock() / (double)CLOCKS_PER_SEC << " sec"
       << '\n';
  return 0;
}
