#include <bits/stdc++.h>
using namespace std;
string s[100005];
int p[100005];
auto cmp = [](int x, int y) { return s[x] > s[y]; };
priority_queue<int, vector<int>, decltype(cmp)> q(cmp);
string ss;
int k;
int main() {
  cin >> ss >> k;
  int len = ss.size();
  for (int i = 0; i < len; ++i) {
    s[i] = ss[i];
    p[i] = i;
    q.push(i);
  }
  for (int i = 1; i < k; ++i) {
    int t = q.top();
    q.pop();
    if (p[t] != len - 1) {
      ++p[t];
      s[t] += ss[p[t]];
      q.push(t);
    }
    if (q.size() == 0) {
      cout << "No such line." << endl;
      return 0;
    }
  }
  int ans = q.top();
  cout << s[ans] << endl;
  return 0;
}
