#include <bits/stdc++.h>
using namespace std;
multiset<pair<string, pair<long long, long long> > > ms;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long i, id, len, k;
  string s, s1;
  cin >> s >> k;
  for (i = 0; i < (int)(s.size()); i++)
    s1.clear(), s1.push_back(s[i]), ms.insert(make_pair(s1, make_pair(i, 1)));
  while ((k--) && (!ms.empty())) {
    s1 = (*(ms.begin())).first;
    id = (*(ms.begin())).second.first;
    len = (*(ms.begin())).second.second;
    ms.erase(ms.begin());
    len++;
    if (id + len <= (int)(s.size()))
      ms.insert(make_pair(s.substr(id, len), make_pair(id, len)));
  }
  if (k == -1)
    cout << s1 << "\n";
  else
    cout << "No such line.\n";
  return 0;
}
