#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
int n, k;
char a[111000];
int main() {
  gets(a);
  scanf("%d", &k);
  n = strlen(a);
  vector<int> cur;
  for (int i = 0, _n = (n); i < _n; i++) cur.push_back(i);
  string res = "";
  --k;
  while (1) {
    long long cnt[26];
    long long sumcnt[26];
    memset(cnt, 0, sizeof cnt);
    ;
    memset(sumcnt, 0, sizeof sumcnt);
    ;
    for (int i = 0, _n = ((int)(cur).size()); i < _n; i++) {
      cnt[a[cur[i]] - 'a']++;
      sumcnt[a[cur[i]] - 'a'] += n - cur[i];
    }
    int ch = 0;
    while (ch < 26 && sumcnt[ch] <= k) {
      k -= sumcnt[ch];
      ch++;
    }
    if (ch >= 26) {
      printf("No such line.\n");
      return 0;
    }
    res += 'a' + ch;
    if (k < cnt[ch]) break;
    k -= cnt[ch];
    vector<int> nw;
    for (int i = 0, _n = ((int)(cur).size()); i < _n; i++)
      if (a[cur[i]] - 'a' == ch && cur[i] + 1 < n) nw.push_back(cur[i] + 1);
    cur.swap(nw);
  }
  printf("%s\n", res.data());
  return 0;
}
