#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 5;
struct SAMclass {
  int len, fa;
  int ch[26];
} t[N << 1];
int tot = 1, las = 1;
int siz[N];
void extend(int c) {
  int p = las, np = las = ++tot;
  siz[np] = 1;
  t[np].len = t[p].len + 1;
  for (; p && !t[p].ch[c]; p = t[p].fa) t[p].ch[c] = np;
  if (!p)
    t[np].fa = 1;
  else {
    int q = t[p].ch[c];
    if (t[q].len == t[p].len + 1)
      t[np].fa = q;
    else {
      int nq = ++tot;
      t[nq] = t[q];
      t[nq].len = t[p].len + 1;
      t[q].fa = t[np].fa = nq;
      for (; p && t[p].ch[c] == q; p = t[p].fa) t[p].ch[c] = nq;
    }
  }
}
int n, type;
long long kth;
char a[N];
long long sum[N];
long long dp(int x) {
  if (~sum[x]) return sum[x];
  sum[x] = siz[x];
  for (int i = 0, y; i < 26; i++) {
    if (!(y = t[x].ch[i])) continue;
    sum[x] += dp(y);
  }
  return sum[x];
}
int one[N], idx;
int ver[N], Next[N];
inline void AddEdge(int a, int b) {
  Next[idx] = one[a];
  ver[idx] = b;
  one[a] = idx++;
}
void Dpsiz(int x) {
  for (int i = one[x], y; ~i; i = Next[i]) {
    y = ver[i];
    Dpsiz(y);
    siz[x] += siz[y];
  }
}
int main() {
  int i, y;
  scanf("%s", a + 1);
  n = strlen(a + 1);
  for (i = 1; i <= n; i++) extend(a[i] - 'a');
  scanf("%lld", &kth);
  memset(one, -1, sizeof one);
  for (i = 1; i <= tot; i++) AddEdge(t[i].fa, i);
  Dpsiz(1);
  siz[1] = 0;
  memset(sum, -1, sizeof sum);
  if (dp(1) < kth) return puts("No such line.") & 0;
  int cur = 1;
  while (kth > 0 && cur) {
    for (i = 0; i < 26; i++) {
      y = t[cur].ch[i];
      if (!y) continue;
      if (kth <= sum[y]) {
        cur = y;
        putchar('a' + i);
        break;
      } else
        kth -= sum[y];
    }
    kth -= siz[cur];
  }
  return 0;
}
