#include <bits/stdc++.h>
using namespace std;
multiset<pair<string, int> > s;
int main() {
  string str;
  int z;
  cin >> str >> z;
  for (int i = 0; i < str.size(); i++) {
    string cur;
    cur += str[i];
    s.insert({cur, i});
  }
  long long n = str.size();
  if (2 * z > n * (n + 1)) {
    cout << "No such line." << endl;
  } else {
    pair<string, int> ans, p;
    while (z--) {
      p = ans = *s.begin();
      s.erase(s.begin());
      if (p.second + 1 < n) {
        p.first += str[p.second + 1];
        p.second += 1;
        s.insert(p);
      }
    }
    cout << ans.first << endl;
  }
  return 0;
}
