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