#include <bits/stdc++.h>
using namespace std;
template <class T>
bool up_max(T& a, const T& b) {
  return b > a ? a = b, 1 : 0;
}
template <class T>
bool up_min(T& a, const T& b) {
  return b < a ? a = b, 1 : 0;
}
priority_queue<pair<string, int>, vector<pair<string, int> >,
               greater<pair<string, int> > >
    Q;
int main() {
  string s;
  long long n, k;
  while (cin >> s >> k) {
    while (!Q.empty()) Q.pop();
    n = s.size();
    if (n * (n + 1) / 2 < k) {
      puts("No such line.\n");
      continue;
    }
    for (int i = 0; i < n; ++i) Q.push(make_pair(string(1, s[i]), i));
    while (--k) {
      pair<string, int> next = Q.top();
      Q.pop();
      if (next.second < n - 1) {
        next.first += s[++next.second];
        Q.push(next);
      }
    }
    cout << Q.top().first << endl;
  }
}
