#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  string txt;
  cin >> txt;
  int k;
  cin >> k;
  int n = txt.size();
  if (1LL * n * (n + 1) / 2 < k) cout << "No such line.\n", exit(0);
  set<pair<string, int> > S;
  for (int i = 0; i < (int)txt.size(); i++) S.insert({string(1, txt[i]), i});
  string ans;
  while (k--) {
    auto it = S.begin();
    ans = it->first;
    auto now = *it;
    S.erase(it);
    now.second++;
    if (now.second < n) {
      now.first += txt[now.second];
      S.insert(now);
    }
  }
  cout << ans << '\n';
  return 0;
}
