#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 100;
char s[N];
int k;
priority_queue<pair<string, int>, vector<pair<string, int> >,
               greater<pair<string, int> > >
    q;
int main() {
  scanf("%s", s + 1);
  int l = strlen(s + 1);
  cin >> k;
  if (2LL * k > (long long)l * (l + 1)) {
    puts("No such line.");
    return 0;
  }
  for (int i = 1; i <= l; i++) {
    string tmp;
    tmp = s[i];
    q.push(pair<string, int>(tmp, i));
  }
  while (--k) {
    pair<string, int> cur = q.top();
    q.pop();
    if (cur.second < l)
      q.push(pair<string, int>(cur.first + s[cur.second + 1], cur.second + 1));
  }
  cout << q.top().first << endl;
  return 0;
}
