#include <bits/stdc++.h>
using namespace std;
long long len, k;
string s;
priority_queue<pair<string, int>, vector<pair<string, int> >,
               greater<pair<string, int> > >
    heap;
int main() {
  cin >> s >> k;
  len = s.size();
  if (len * (len + 1) / 2 < k) {
    printf("No such line.\n");
    return 0;
  }
  for (int i = 0; i < len; ++i) heap.push(make_pair(string(1, s[i]), i));
  --k;
  while (k) {
    pair<string, int> a = heap.top();
    heap.pop();
    if (a.second < len - 1)
      heap.push(make_pair(a.first + s[a.second + 1], a.second + 1));
    --k;
  }
  cout << heap.top().first << endl;
  return 0;
}
