#include <bits/stdc++.h>
const int N = 1e5 + 10;
template <int maxn, int maxc>
class Suffix_Automaton {
 private:
  static const int maxs = maxn << 1;
  long long tot[maxs];
  int last, cnt, n, son[maxs][26], fa[maxs], len[maxs], size[maxs], sum[maxn],
      rnk[maxs];
  inline const void extend(int c) {
    int p = last, np = ++cnt;
    len[last = np] = len[p] + (size[np] = 1);
    for (; p && !son[p][c]; p = fa[p]) son[p][c] = np;
    if (!p) return fa[np] = 1, void();
    int q = son[p][c];
    if (len[q] == len[p] + 1) return fa[np] = q, void();
    int nq = ++cnt;
    len[nq] = len[p] + 1;
    memcpy(son[nq], son[q], sizeof(son[q]));
    fa[nq] = fa[q];
    fa[q] = fa[np] = nq;
    for (; son[p][c] == q; p = fa[p]) son[p][c] = nq;
  }
  inline const void radixsort() {
    for (int i = 1; i <= cnt; i++) sum[len[i]]++;
    for (int i = 1; i <= n; i++) sum[i] += sum[i - 1];
    for (int i = 1; i <= cnt; i++) rnk[sum[len[i]]--] = i;
  }

 public:
  inline const void build(char *s) {
    last = cnt = 1;
    n = strlen(s + 1);
    for (int i = 1; i <= n; i++) extend(s[i] - 'a');
    radixsort();
    for (int i = cnt; i; i--) size[fa[rnk[i]]] += size[rnk[i]];
    size[1] = 0;
    for (int i = cnt; i; i--) {
      int p = rnk[i];
      tot[p] = size[p];
      for (int j = 0; j < 26; j++) tot[p] += tot[son[p][j]];
    }
  }
  inline const void query(int k) {
    if (k > tot[1]) return puts("No such line."), void();
    int p = 1;
    while ((k -= size[p]) > 0) {
      int i = 0;
      for (; k > tot[son[p][i]] && i < 26; i++) k -= tot[son[p][i]];
      p = son[p][i];
      putchar(i + 'a');
    }
  }
};
Suffix_Automaton<N, 26> sam;
char s[N];
int k;
int main() {
  scanf("%s", s + 1);
  scanf("%d", &k);
  sam.build(s);
  sam.query(k);
  return 0;
}
