#include <bits/stdc++.h>
using namespace std;
string s, res;
vector<int> cnt, ncnt;
int k;
int main() {
  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 pos = 0;
    while (k > num[pos] && pos < 26) {
      k -= num[pos];
      pos++;
    }
    if (pos >= 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' == pos)
        ncnt.push_back(cnt[i]);
    swap(cnt, ncnt);
    k -= cnt.size();
    res += (pos + 'a');
  }
  cout << res << endl;
  return 0;
}
