#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
struct Node {
  string str;
  int pos;
  friend bool operator<(Node const& n1, Node const& n2) {
    return n2.str < n1.str;
  }
};
priority_queue<Node> que;
int main() {
  int k;
  string str;
  cin >> str;
  cin >> k;
  que.push({string{'z' + 1}, INF});
  for (int i = 0; i < str.size(); ++i) {
    que.push({string{str[i]}, i});
  }
  Node i;
  while (k-- && !que.empty()) {
    i = que.top();
    que.pop();
    if (i.pos == str.size() - 1 || i.pos == INF) continue;
    que.push({i.str + str[i.pos + 1], i.pos + 1});
  }
  if (k && que.empty())
    cout << "No such line." << endl;
  else
    cout << i.str << endl;
}
