#include <bits/stdc++.h>
using namespace std;
const long long p = 17239;
const int N = 1000000;
int s[N], n;
long long h[N], ppow[N], sum[N];
char str[N], res[N];
long long get_h(int i, int l) {
  return h[i + l - 1] - ((i == 0) ? 0 : h[i - 1]) * ppow[l];
}
bool cmp(int i, int j) {
  int l = 0, r = min(n - i, n - j);
  while (l < r) {
    int q = (l + r + 1) / 2;
    if (get_h(i, q) == get_h(j, q))
      l = q;
    else
      r = q - 1;
  }
  return str[i + l] < str[j + l];
}
int find_char_at(int l, int r, int i, char c) {
  while (l < r) {
    int q = (l + r + 1) / 2;
    if (str[s[q] + i] <= c)
      l = q;
    else
      r = q - 1;
  }
  if (str[s[l] + i] <= c)
    return l;
  else
    return l - 1;
}
int main() {
  int k;
  scanf("%s%d", str, &k);
  n = strlen(str);
  for (int i = 0; i < n; ++i) {
    h[i] = ((i == 0) ? 0 : h[i - 1]) * p + str[i];
    s[i] = i;
  }
  ppow[0] = 1;
  for (int i = 1; i <= n; ++i) ppow[i] = ppow[i - 1] * p;
  sort(s, s + n, cmp);
  for (int i = 0; i < n; ++i) sum[i] = ((i == 0) ? 0 : sum[i - 1]) + n - s[i];
  if (k > sum[n - 1]) {
    printf("No such line.\n");
    return 0;
  }
  int l = 0, r = n - 1;
  for (int i = 0; i < n; ++i) {
    for (char c = 'a'; c <= 'z'; ++c) {
      res[i] = c;
      int rnew = find_char_at(l, r, i, c);
      long long tmp = sum[rnew] - sum[l - 1] - i * 1ll * (rnew - l + 1);
      if (tmp >= k) {
        r = rnew;
        break;
      }
      l = rnew + 1;
      k -= tmp;
    }
    if (k <= r - l + 1) {
      printf("%s\n", res);
      return 0;
    }
    k -= (r - l + 1);
    while ((s[l] + i + 1 == n) && (l <= r)) l++;
    assert(l <= r);
  }
  return 0;
}
