#include <bits/stdc++.h>
using namespace std;
set<pair<string, int> > strs;
int main() {
  string s;
  int k;
  cin >> s;
  cin >> k;
  long long l = (int(s.size()));
  if ((l * (l + 1)) / 2 < k) {
    puts("No such line.");
    return 0;
  }
  for (int i = 0; i < (int(s.size())); i++) {
    strs.insert(make_pair(string(1, s[i]), i));
  }
  while (k-- > 1) {
    string tmp = (*strs.begin()).first;
    int id = (*strs.begin()).second;
    strs.erase(strs.begin());
    if (id + 1 < (int(s.size()))) {
      tmp += s[id + 1];
      strs.insert(make_pair(tmp, id + 1));
    }
  }
  cout << (*strs.begin()).first << endl;
}
