#include <bits/stdc++.h>
using namespace std;
string s;
int k;
priority_queue<pair<string, int>, vector<pair<string, int> >,
               greater<pair<string, int> > >
    fila;
int main() {
  cin >> s;
  scanf("%d", &k);
  long long n = s.size();
  if (n * (n + 1) / 2 < k)
    printf("No such line.\n");
  else {
    for (int i = 0; i < n; i++) {
      string aux = "";
      aux += s[i];
      fila.push(pair<string, int>(aux, i));
    }
    for (int i = 0; i < k - 1; i++) {
      pair<string, int> x = fila.top();
      fila.pop();
      if (x.second != n - 1)
        fila.push(pair<string, int>(x.first + s[x.second + 1], x.second + 1));
    }
    cout << fila.top().first << endl;
  }
  return 0;
}
