#include <bits/stdc++.h>
using namespace std;
priority_queue<pair<string, int>, vector<pair<string, int> >,
               greater<pair<string, int> > >
    Q;
int main() {
  string s;
  int k;
  cin >> s >> k;
  int n = s.size();
  string t;
  for (int i = 0; i < n; i++) {
    t = s[i];
    Q.push(make_pair(t, i));
  }
  while (!Q.empty()) {
    int i = Q.top().second;
    t = Q.top().first;
    Q.pop();
    k--;
    if (k == 0) {
      cout << t << "\n";
      return 0;
    }
    if (i < n - 1) {
      t += s[i + 1];
      Q.push(make_pair(t, i + 1));
    }
  }
  cout << "No such line.";
}
