#include <bits/stdc++.h>
using namespace std;
set<pair<string, int> > s;
string p;
int k;
int main() {
  ios_base::sync_with_stdio(false);
  cin >> p >> k;
  for (int i = 0; i < p.size(); ++i) {
    string hlp = "";
    hlp += p[i];
    s.insert(pair<string, int>(hlp, i));
  }
  while (--k && s.size()) {
    string q = s.begin()->first;
    int end = s.begin()->second;
    s.erase(s.begin());
    end++;
    if (end < p.size()) {
      q += p[end];
      s.insert(pair<string, int>(q, end));
    }
  }
  if (s.size())
    cout << s.begin()->first << endl;
  else
    cout << "No such line." << endl;
  return 0;
}
