#include <bits/stdc++.h>
#pragma GCC optimize(3)
#pragma G++ optimize(3)
using namespace std;
const int maxn = 100010;
string s;
int n, k;
multiset<pair<string, int> > st;
int main() {
  cin >> s >> k;
  n = s.size();
  if (k > 1LL * n * (n + 1) / 2) {
    cout << "No such line.";
    return 0;
  }
  for (int i = 0; i < n; i++) st.insert({s.substr(i, 1), i});
  while (--k) {
    pair<string, int> x = *st.begin();
    st.erase(st.begin());
    if (x.second < n - 1) st.insert({x.first + s[++x.second], x.second});
  }
  cout << st.begin()->first;
}
