#include <bits/stdc++.h>
using namespace std;
char str[120000];
struct cmp {
  bool operator()(pair<int, int> &a, pair<int, int> &b) {
    return lexicographical_compare(str + b.first, str + b.second, str + a.first,
                                   str + a.second);
  }
};
int main() {
  priority_queue<pair<int, int>, vector<pair<int, int> >, cmp> q;
  int k, n;
  scanf("%s%d", str, &k);
  n = strlen(str);
  for (int i = 0; i < (int)(n); i++) {
    q.push(make_pair(i, i + 1));
  }
  while (--k > 0 && !q.empty()) {
    pair<int, int> cur = q.top();
    q.pop();
    if (cur.second + 1 <= n) {
      q.push(make_pair(cur.first, cur.second + 1));
    }
  }
  if (q.empty()) {
    printf("No such line.");
  } else {
    pair<int, int> ans = q.top();
    str[ans.second] = 0;
    puts(str + ans.first);
  }
  return 0;
}
