#include <bits/stdc++.h>
using namespace std;
const int maxn = 308611;
struct sam {
  sam *son[26], *pre;
  int len;
  long long cnt, g;
  void init() {
    memset(son, 0, sizeof(son));
    pre = 0;
    len = 0;
    cnt = 0;
    g = 0;
  }
} que[maxn], *root, *tail, *b[maxn];
int tot;
void initt() {
  tot = 0;
  tail = root = &que[tot++];
  root->init();
}
void add(int c, int len) {
  sam *p = tail, *np = &que[tot++];
  np->init();
  np->len = len;
  tail = np;
  for (; p && p->son[c] == NULL; p = p->pre) p->son[c] = np;
  if (p == NULL)
    np->pre = root;
  else {
    sam *q = p->son[c];
    if (p->len + 1 == q->len)
      np->pre = q;
    else {
      sam *nq = &que[tot++];
      *nq = *q;
      nq->len = p->len + 1;
      np->pre = q->pre = nq;
      for (; p && p->son[c] == q; p = p->pre) p->son[c] = nq;
    }
  }
}
char str[maxn];
int k;
int cup[maxn];
bool flag = 0;
void dfs(sam *p, int k) {
  k -= p->g;
  if (k <= 0) {
    flag = 1;
    return;
  }
  for (int i = 0; i < 26; i++) {
    if (flag) return;
    if (p->son[i]) {
      if (k > p->son[i]->cnt) {
        k -= p->son[i]->cnt;
      } else {
        printf("%c", i + 'a');
        dfs(p->son[i], k);
      }
    }
  }
}
int main() {
  while (~scanf("%s", str)) {
    initt();
    scanf("%d", &k);
    for (int i = 0; str[i]; i++) add(str[i] - 'a', i + 1);
    memset(cup, 0, sizeof(cup));
    int n = strlen(str);
    for (int i = 0; i < tot; i++) cup[que[i].len]++;
    for (int i = 1; i <= n; i++) cup[i] += cup[i - 1];
    for (int i = 0; i < tot; i++) b[--cup[que[i].len]] = &que[i];
    sam *p = root;
    for (int i = 0; str[i]; i++) p = p->son[str[i] - 'a'], p->cnt++;
    for (int i = tot - 1; i > 0; i--) {
      p = b[i];
      p->pre->cnt += p->cnt;
    }
    for (int i = tot - 1; i > 0; i--) b[i]->g = b[i]->cnt;
    for (int i = tot - 1; i >= 0; i--) {
      p = b[i];
      for (int i = 0; i < 26; i++)
        if (p->son[i]) p->cnt += p->son[i]->cnt;
    }
    flag = 0;
    if (k >= root->cnt)
      printf("No such line.");
    else
      dfs(root, k);
    puts("");
  }
  return 0;
}
