#include <bits/stdc++.h>
using namespace std;
struct node {
  node *par, *go[26];
  int num;
  long long sum;
  int val;
} * root, *tail, que[200010], *top[200010];
int tot;
char str[200010 >> 1];
void add(int c, int l) {
  node *p = tail, *np = &que[tot++];
  np->val = l;
  while (p && p->go[c] == NULL) p->go[c] = np, p = p->par;
  if (p == NULL)
    np->par = root;
  else {
    node *q = p->go[c];
    if (p->val + 1 == q->val)
      np->par = q;
    else {
      node *nq = &que[tot++];
      *nq = *q;
      nq->val = p->val + 1;
      np->par = q->par = nq;
      while (p && p->go[c] == q) p->go[c] = nq, p = p->par;
    }
  }
  tail = np;
}
int c[200010], len;
void init() {
  memset(que, 0, sizeof(que));
  tot = 0;
  len = 1;
  root = tail = &que[tot++];
}
void solve() {
  int i, j;
  memset(c, 0, sizeof(c));
  for (i = 0; i < tot; i++) c[que[i].val]++;
  for (i = 1; i < len; i++) c[i] += c[i - 1];
  for (i = 0; i < tot; i++) top[--c[que[i].val]] = &que[i];
  for (node *p = root;; p = p->go[str[p->val] - 'a']) {
    p->num = 1;
    if (p->val == len - 1) break;
  }
  for (i = tot - 1; i >= 0; i--) {
    node *p = top[i];
    if (p->par) {
      node *q = p->par;
      q->num += p->num;
    }
    for (j = 0; j < 26; j++) {
      if (p->go[j]) p->sum += p->go[j]->num + p->go[j]->sum;
    }
  }
}
int ans[200010];
void dfs(int k) {
  node *p = root;
  if (k > p->sum) {
    printf("No such line.\n");
    return;
  }
  int x;
  int i;
  while (1) {
    for (i = 0; i < 26; i++) {
      if (p->go[i]) {
        node *q = p->go[i];
        if (k > q->sum + q->num) {
          k -= q->sum + q->num;
        } else {
          x = i;
          break;
        }
      }
    }
    printf("%c", x + 'a');
    p = p->go[x];
    k -= p->num;
    if (k <= 0) break;
  }
  printf("\n");
}
int main() {
  scanf("%s", str);
  int i, l = strlen(str), k;
  init();
  for (i = 0; i < l; i++) add(str[i] - 'a', len++);
  solve();
  scanf("%d", &k);
  dfs(k);
  return 0;
}
