#include <bits/stdc++.h>
using namespace std;
pair<string, int> temp;
priority_queue<pair<string, int>, vector<pair<string, int> >,
               greater<pair<string, int> > >
    q;
void func(string &s, int k) {
  long long n = s.size();
  if (n == 1 && k == 1) {
    cout << s << endl;
    return;
  }
  if (k > n * (n + 1) / 2) {
    cout << "No such line." << endl;
    return;
  }
  for (int i = 0; i < n; i++) q.push(make_pair(s.substr(i, 1), i));
  for (int i = 1; i <= k - 1; i++) {
    temp = q.top();
    q.pop();
    if (temp.second >= s.size() - 1) continue;
    temp.second++;
    temp.first += s[temp.second];
    q.push(temp);
  }
  cout << q.top().first << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  string s;
  cin >> s;
  int k;
  cin >> k;
  func(s, k);
  return 0;
}
