#include <bits/stdc++.h>
using namespace std;
void solve() {
  string s;
  cin >> s;
  long long n = s.size();
  long long k;
  cin >> k;
  if (k > n * (n + 1) / 2) {
    cout << "No such line.\n";
    return;
  }
  set<int> pos;
  for (int i = 0; i < n; i++) pos.insert(i);
  string ans = "";
  while (k > 0) {
    bool added = false;
    for (char letter = 'a'; letter <= 'z'; letter++) {
      long long substr_cnt = 0;
      int letter_cnt = 0;
      for (auto e : pos) {
        if (s[e] == letter) {
          letter_cnt++;
          substr_cnt += (n - e);
        }
      }
      if (substr_cnt < k) {
        k -= substr_cnt;
        continue;
      }
      added = true;
      ans.push_back(letter);
      k -= letter_cnt;
      set<int> newpos;
      for (auto e : pos) {
        if (s[e] == letter && e < n - 1) newpos.insert(e + 1);
      }
      pos = newpos;
      break;
    }
    if (!added) {
      int w = 0;
      cout << 10 / w;
    }
  }
  cout << ans << "\n";
  return;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int amount_of_tests = 1;
  for (int i = 0; i < amount_of_tests; i++) {
    solve();
  }
  return 0;
}
