#include <bits/stdc++.h>
using namespace std;
struct SUBS {
  string _s;
  int l, r;
  SUBS() {}
  SUBS(string s, int l, int r) : _s(s), l(l), r(r) {}
  bool operator<(const SUBS& subs) const { return _s > subs._s; }
};
priority_queue<SUBS> pq;
string s;
long long n, k;
int main() {
  cin >> s;
  cin >> k;
  n = s.length();
  if (2 * k > n * (n + 1)) {
    cout << "No such line." << endl;
    return 0;
  }
  for (int i = 0; i < n; i++) pq.push(SUBS(s.substr(i, 1), i, i + 1));
  SUBS subs;
  for (int i = 0; i < k; i++) {
    subs = pq.top();
    pq.pop();
    if (subs.r < n) {
      int len = subs.r - subs.l;
      pq.push(SUBS(s.substr(subs.l, len + 1), subs.l, subs.r + 1));
    }
  }
  cout << subs._s << endl;
}
