#include <bits/stdc++.h>
using namespace std;
template <class T>
inline T INT_LEN(T v) {
  int len = 1;
  while (v /= 10) ++len;
  return len;
}
char s[100005];
long long num[30], sum[30];
int ind[100005];
int K;
int solve(int k) {
  int i, j, n = (int)strlen(s), tem;
  int len = n;
  char ch;
  for (i = 0; i < n; i++) ind[i] = i;
  if ((long long)(-~n) * n >> 1 < k) return puts("No such line.") && 0;
  while (k > 0) {
    memset(num, 0, sizeof(num));
    memset(sum, 0, sizeof(sum));
    for (i = 0; i < n; i++) {
      j = ind[i];
      num[s[j] - 'a']++;
      sum[s[j] - 'a'] += len - j;
    }
    for (i = 0; i < 26; i++) {
      if (sum[i] >= k) {
        ch = 'a' + i;
        break;
      } else {
        k -= sum[i];
      }
    }
    putchar(ch);
    k -= num[i];
    tem = n;
    n = 0;
    for (i = 0; i < tem; i++) {
      if (s[ind[i]] == ch && ind[i] < ~-len) ind[n++] = -~ind[i];
    }
  }
  return puts("") && 0;
}
int main(void) {
  while (~scanf("%s", s)) {
    scanf("%d", &K);
    solve(K);
  }
  return 0;
}
