#include <bits/stdc++.h>
using namespace std;
string s, res;
vector<int> cnt, ncnt;
int k;
int main() {
  res = "";
  cin >> s >> k;
  int n = s.size();
  for (int i = 0; i < n; i++) cnt.push_back(i);
  if ((1LL * n * (n + 1)) / 2LL < k) {
    cout << "No such line." << endl;
    return 0;
  }
  while (k > 0) {
    long long num[26] = {0};
    for (int i = 0; i < cnt.size(); i++)
      if (cnt[i] + res.size() < n)
        num[s[cnt[i] + res.size()] - 'a'] += (n - cnt[i] - res.size());
    int ch = 0;
    while (ch < 26 && k > num[ch]) {
      k -= num[ch];
      ch++;
    }
    if (ch >= 26) {
      cout << "No such line." << endl;
      return 0;
    }
    ncnt.clear();
    for (int i = 0; i < cnt.size(); i++)
      if (cnt[i] + res.size() < n && s[cnt[i] + res.size()] - 'a' == ch)
        ncnt.push_back(cnt[i]);
    res += (ch + 'a');
    swap(ncnt, cnt);
    k -= cnt.size();
  }
  cout << res.data() << endl;
  return 0;
}
