#include <bits/stdc++.h>
using namespace std;
char s[100010], a[100010];
int n, c[100010], len, cn, K, an;
long long g[30];
int main() {
  int i, j, ccn;
  while (scanf("%s%d", s, &K) != EOF) {
    n = strlen(s);
    if (K > 1LL * n * (n + 1) / 2) {
      puts("No such line.");
      continue;
    }
    for (i = 0; i < n; i++) c[i] = i;
    cn = n, an = 0;
    while (true) {
      memset(g, 0, sizeof(g));
      for (i = 0; i < cn; i++) g[s[c[i]] - 'a'] += n - c[i];
      for (i = 0; i < 26; i++) {
        if (g[i] >= K)
          break;
        else
          K -= g[i];
      }
      a[an++] = i + 'a';
      ccn = 0;
      for (j = 0; j < cn; j++)
        if (s[c[j]] == i + 'a') {
          K -= 1;
          if (c[j] + 1 < n) c[ccn++] = c[j] + 1;
        }
      cn = ccn;
      if (K <= 0) break;
    }
    a[an] = 0;
    printf("%s\n", a);
  }
  return 0;
}
