#include <bits/stdc++.h>
using namespace std;
int const MAX = 100005;
int const OO = (1 << 28);
char str[MAX * 2];
int gID[MAX];
int suf[MAX];
int ngID[MAX];
int K, N;
int h;
bool cmp(int a, int b) {
  return gID[a] < gID[b] || (gID[a] == gID[b] && gID[a + h] < gID[b + h]);
}
void buildSuffix() {
  for (N = 0; str[N]; ++N) suf[N] = N, gID[N] = str[N];
  suf[N] = N;
  ngID[N++] = -1;
  for (h = 1; ngID[N - 1] != N - 1; h <<= 1) {
    sort(suf, suf + N, cmp);
    for (int i = 1; i < N; ++i) ngID[i] = ngID[i - 1] + cmp(suf[i - 1], suf[i]);
    for (int i = 0; i < N; ++i) gID[suf[i]] = ngID[i];
  }
}
int nch;
bool comp(int idx1, int idx2) { return str[idx1 + nch] < str[idx2 + nch]; }
long long cuml[MAX];
bool solve() {
  for (int i = 1; i < N; ++i) {
    cuml[i] = N - 1 - suf[i] + cuml[i - 1];
  }
  if (cuml[N - 1] < K) return false;
  int st = 0, en = N, ss, ee;
  char *res = str + N;
  nch = 0;
  while (K) {
    for (char c = 'a'; c <= 'z'; c++) {
      res[nch] = c;
      ss = lower_bound(suf + st, suf + en, N, comp) - suf;
      ee = upper_bound(suf + ss, suf + en, N, comp) - suf;
      long long cnt = cuml[ee - 1] - cuml[ss - 1] - (nch * (ee - ss));
      if (cnt < K)
        K -= cnt;
      else
        break;
    }
    nch++;
    if (K <= ee - ss)
      break;
    else
      K -= (ee - ss);
    st = ss;
    en = ee;
  }
  res[nch] = '\0';
  return true;
}
int main() {
  scanf("%s", str);
  scanf("%d", &K);
  buildSuffix();
  if (!solve())
    printf("No such line.");
  else
    printf(str + N);
  return 0;
}
