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