#include <bits/stdc++.h>
using namespace std;
const int N = (int)1e5 + 10;
struct Node {
  string s;
  int i;
  bool operator<(const Node &r) const { return s > r.s; }
  Node() = default;
  Node(string s, int i) : s(std::move(s)), i(i) {}
};
string s;
int k, n;
priority_queue<Node> que;
int main() {
  cin >> s >> k;
  n = s.length();
  for (int i = 0; i < n; i++) que.emplace(string(1, s[i]), i);
  string last;
  while (k && !que.empty()) {
    auto nod = que.top();
    que.pop();
    last = nod.s;
    if (nod.i + nod.s.length() < n) {
      nod.s.push_back(s[nod.i + nod.s.length()]);
      que.push(std::move(nod));
    }
    --k;
  }
  if (que.empty() && k)
    cout << "No such line." << endl;
  else
    cout << last << endl;
}
