#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;
  cin >> s;
  int k;
  cin >> k;
  int n = s.length();
  long long x = (n * 1LL * (n + 1)) / 2;
  if (k > x) {
    cout << "No such line." << endl;
    return 0;
  }
  string tmp;
  for (int i = 0; i < n; i++) {
    tmp = s[i];
    q.push(make_pair(tmp, i));
  }
  string a;
  int b;
  while (!q.empty()) {
    a = q.top().first;
    b = q.top().second;
    q.pop();
    k--;
    if (k == 0) break;
    if (b + 1 < n) a += s[b + 1], q.push(make_pair(a, b + 1));
  }
  if (!k)
    cout << a << endl;
  else
    cout << "No such line." << endl;
}
