#include <bits/stdc++.h>
using namespace std;
long long p = 29;
long long mod = 1000 * 1000 * 1000 + 3777;
vector<long long> h;
vector<long long> pows;
void build(string s) {
  h.assign(s.size(), 0);
  pows.assign(s.size(), 1);
  h[0] = s[0] - 'a' + 1;
  for (int i = 1; i < s.size(); i++) {
    h[i] = (h[i - 1] * p + (s[i] - 'a' + 1)) % mod;
    pows[i] = (pows[i - 1] * p) % mod;
  }
}
long long get(int l, int r) {
  if (l == 0)
    return h[r];
  else
    return ((h[r] - h[l - 1] * pows[r - l + 1]) % mod + mod) % mod;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  string s;
  int k;
  cin >> s >> k;
  build(s);
  unordered_map<char, long long> c(27);
  unordered_set<int> pos;
  string ans = "";
  long long n = s.size();
  if (n * (n + 1) / 2 < k) {
    cout << "No such line.";
    return 0;
  }
  for (int i = 0; i < n; i++) {
    c[s[i]] += (n - i);
    pos.insert(i);
  }
  long long sum = 0;
  for (char i = 'a'; i <= 'z'; i++) {
    sum += c[i];
    if (sum >= k) {
      sum -= c[i];
      k -= sum;
      ans += i;
      break;
    }
  }
  if (k == 0) {
    cout << ans;
    return 0;
  }
  long long ah = ans[0] - 'a' + 1;
  vector<int> to_er;
  while (true) {
    c.clear();
    sum = 0;
    int l = ans.size();
    for (int i : pos) {
      if (get(i, i + l - 1) == ah) {
        c[' ']++;
        if (i + l != n) {
          c[s[i + l]] += (n - (i + l));
        }
      } else {
        to_er.push_back(i);
      }
    }
    for (int i : to_er) {
      pos.erase(i);
    }
    to_er.clear();
    k -= c[' '];
    if (k <= 0) {
      break;
    }
    for (char i = 'a'; i <= 'z'; i++) {
      sum += c[i];
      if (sum >= k) {
        sum -= c[i];
        k -= sum;
        ans += i;
        break;
      }
    }
    if (k <= 0) {
      break;
    }
    ah *= p;
    ah += ans[ans.size() - 1] - 'a' + 1;
    ah %= mod;
  }
  cout << ans;
}
