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