#include <bits/stdc++.h>
using namespace std;
char s[100005];
int len, nlen, olen;
int k, v[100005], nv[100005];
void func(int step) {
  long long tot = 0, cnt = 0;
  for (int i = 0; i < 26; i++) {
    tot = 0;
    cnt = 0;
    nlen = 0;
    for (int j = 0; j < len; j++)
      if (v[j] + step < olen && s[v[j] + step] - 'a' == i)
        tot += olen - v[j] - step, cnt++, nv[nlen] = v[j], nlen++;
    if (k >= tot) {
      k -= tot;
    } else {
      printf("%c", i + 'a');
      if (k < cnt) return;
      for (int j = 0; j < nlen; j++) v[j] = nv[j];
      len = nlen;
      k -= cnt;
      func(step + 1);
      break;
    }
  }
}
int main() {
  scanf("%s%d", s, &k);
  len = strlen(s);
  olen = len;
  if ((long long)len * (long long)(len + 1) < k * 2LL) {
    printf("No such line.\n");
    return 0;
  }
  k--;
  for (int i = 0; i < len; i++) v[i] = i;
  func(0);
  printf("\n");
}
