#include <bits/stdc++.h>
using namespace std;
vector<long long> sorted_cyclic_shifts(string const& s) {
  long long n = s.size();
  vector<long long> p(n), c(n), pn(n), cn(n), cnt(n + 256, 0);
  for (long long i = 0; i < n; i++) cnt[s[i]]++;
  for (long long i = 1; i < 256; i++) cnt[i] += cnt[i - 1];
  for (long long i = 0; i < n; i++) p[--cnt[s[i]]] = i;
  c[p[0]] = 0;
  long long classes = 1;
  for (long long i = 1; i < n; i++) {
    if (s[p[i]] != s[p[i - 1]]) classes++;
    c[p[i]] = classes - 1;
  }
  for (long long h = 0; (1 << h) < n; h++) {
    for (long long i = 0; i < n; i++) {
      pn[i] = p[i] - (1 << h);
      if (pn[i] < 0) pn[i] += n;
    }
    fill(cnt.begin(), cnt.begin() + classes, 0);
    for (long long i = 0; i < n; i++) cnt[c[pn[i]]]++;
    for (long long i = 1; i < classes; i++) cnt[i] += cnt[i - 1];
    for (long long i = n - 1; i >= 0; i--) p[--cnt[c[pn[i]]]] = pn[i];
    cn[p[0]] = 0;
    classes = 1;
    for (long long i = 1; i < n; i++) {
      pair<long long, long long> cur = {c[p[i]], c[(p[i] + (1 << h)) % n]};
      pair<long long, long long> prev = {c[p[i - 1]],
                                         c[(p[i - 1] + (1 << h)) % n]};
      if (cur != prev) classes++;
      cn[p[i]] = classes - 1;
    }
    c.swap(cn);
  }
  return p;
}
vector<long long> suffix_array_construction(string s) {
  s += "#";
  vector<long long> sorted_shifts = sorted_cyclic_shifts(s);
  sorted_shifts.erase(sorted_shifts.begin());
  return sorted_shifts;
}
vector<long long> lcp_construction(string const& s,
                                   vector<long long> const& p) {
  long long n = s.size();
  vector<long long> rank(n, 0);
  for (long long i = 0; i < n; i++) rank[p[i]] = i;
  long long k = 0;
  vector<long long> lcp(n - 1, 0);
  for (long long i = 0; i < n; i++) {
    if (rank[i] == n - 1) {
      k = 0;
      continue;
    }
    long long j = p[rank[i] + 1];
    while (i + k < n and j + k < n and s[i + k] == s[j + k]) k++;
    lcp[rank[i]] = k;
    if (k) k--;
  }
  return lcp;
}
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  string s;
  cin >> s;
  long long k;
  cin >> k;
  string w = s;
  auto p = suffix_array_construction(w);
  auto lcp = lcp_construction(w, p);
  long long ans = 0;
  long long n = s.length();
  vector<long long> vis(n, 0);
  for (long long i = 0; i < p.size(); i++) {
    if (i == n - 1) {
      if (k > n - p[i] - vis[i])
        cout << "No such line.";
      else
        for (long long l = p[i]; l < p[i] + vis[i] + k; l++) cout << s[l];
    } else {
      long long j = vis[i] + 1;
      while (j <= n - p[i]) {
        k -= 1;
        long long z = i;
        while (k > 0 and z < n - 1) {
          if (lcp[z] >= j) {
            vis[z + 1] = j;
            k--;
            z++;
          } else
            break;
        }
        if (k == 0) {
          for (long long l = p[i]; l < p[i] + j; l++) cout << s[l];
          return 0;
        }
        j++;
      }
    }
  }
  return 0;
}
