#include <bits/stdc++.h>
using namespace std;
struct Node {
  string s;
  int k;
};
bool operator<(Node a, Node b) { return a.s > b.s; }
priority_queue<Node> pq;
string s;
int main() {
  int i, j, k;
  Node tmp;
  string ans, top;
  cin >> s >> k;
  for (i = 0; i < s.size(); i++) {
    tmp.s.clear();
    tmp.s += s[i];
    tmp.k = i;
    pq.push(tmp);
  }
  while (k--) {
    if (pq.empty()) break;
    tmp = pq.top();
    if (k == 0) ans = tmp.s;
    pq.pop();
    if (tmp.k + 1 < s.size()) {
      tmp.s += s[++tmp.k];
      pq.push(tmp);
    }
  }
  if (k == -1)
    cout << ans << endl;
  else
    cout << "No such line." << endl;
}
