#include <bits/stdc++.h>
using namespace std;
const int maxn = 100002;
const int alpha = 256;
char buf[maxn];
string s, res = "";
int k;
long long cnt[alpha];
int classes[maxn];
int c_class;
int n_classes[maxn];
int n_c_class;
int main() {
  scanf("%s\n", buf);
  scanf("%d", &k);
  s = buf;
  for (int i = 0; i < alpha; ++i) cnt[i] = 0;
  for (size_t i = 0; i < s.size(); ++i) cnt[s[i]] += s.size() - i;
  char c;
  for (int i = 0; i < alpha; ++i)
    if (k <= cnt[i]) {
      c = i;
      break;
    } else
      k -= cnt[i];
  c_class = 0;
  for (size_t i = 0; i < s.size(); ++i)
    if (s[i] == c) classes[c_class++] = i;
  res = c;
  while (true) {
    for (int i = 0; i < alpha; ++i) cnt[i] = 0;
    for (int i = 0; i < c_class; ++i) {
      if (classes[i] + 1 < s.size()) {
        cnt[s[classes[i] + 1]] += s.size() - classes[i] - 1;
      }
      ++cnt[' '];
    }
    char cur = '-';
    for (int i = 0; i < alpha; ++i)
      if (k <= cnt[i]) {
        cur = i;
        break;
      } else
        k -= cnt[i];
    if (cur == '-') {
      printf("No such line.\n");
      return 0;
    }
    if (cur == ' ') break;
    res += cur;
    n_c_class = 0;
    for (int i = 0; i < c_class; ++i)
      if (classes[i] + 1 < s.size() && s[classes[i] + 1] == cur)
        n_classes[n_c_class++] = classes[i] + 1;
    c_class = n_c_class;
    for (int i = 0; i < c_class; ++i) classes[i] = n_classes[i];
  }
  printf("%s\n", res.c_str());
  return 0;
}
