#include <bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/STACK:1024000000,1024000000")
int cao;
struct node {
  node *f, *next[26];
  int len;
  int id;
  node() {}
  node(int x) {
    f = 0;
    id = 1;
    len = x;
    memset(next, 0, sizeof(next));
  }
} v[500005];
node *now;
node *root;
node *newnode(int x) {
  v[cao] = node(x);
  return &v[cao++];
}
void init() {
  cao = 0;
  root = now = newnode(0);
}
void gao(int x) {
  node *p = now;
  node *np = newnode(p->len + 1);
  while (p && p->next[x] == 0) {
    p->next[x] = np;
    p = p->f;
  }
  if (p == 0)
    np->f = root;
  else {
    node *q = p->next[x];
    if (q->len == p->len + 1)
      np->f = q;
    else {
      node *nq = newnode(p->len + 1);
      nq->f = q->f;
      q->f = nq;
      np->f = nq;
      nq->id = 0;
      memcpy(nq->next, q->next, sizeof(q->next));
      while (p && p->next[x] == q) {
        p->next[x] = nq;
        p = p->f;
      }
    }
  }
  now = np;
}
vector<int> so[500005];
char ch[100005];
long long a[500005];
long long b[500005];
void dfs1(int x) {
  a[x] = v[x].id;
  for (int i = 0; i < so[x].size(); i++) {
    int y = so[x][i];
    dfs1(y);
    a[x] += a[y];
  }
}
long long dfs(int x) {
  if (b[x] != -1) return b[x];
  b[x] = a[x];
  for (int i = 0; i <= 25; i++) {
    if (v[x].next[i] == 0) continue;
    int y = v[x].next[i] - v;
    b[x] += dfs(y);
  }
  return b[x];
}
long long rt;
char sta[100005];
int top;
int run() {
  top = 0;
  int x = 0;
  if (rt > b[0]) {
    return 0;
  }
  while (1) {
    if (rt <= a[x]) return 1;
    rt -= a[x];
    for (int i = 0; i <= 25; i++) {
      if (v[x].next[i] == 0) continue;
      int y = v[x].next[i] - v;
      if (rt <= b[y]) {
        sta[top++] = 'a' + i;
        x = y;
        break;
      } else
        rt -= b[y];
    }
  }
}
int main() {
  init();
  scanf("%s", ch);
  scanf("%I64d", &rt);
  int l = strlen(ch);
  for (int i = 0; i < l; i++) gao(ch[i] - 'a');
  for (int i = 0; i < cao; i++) so[i].clear();
  for (int i = 1; i < cao; i++) so[v[i].f - v].push_back(i);
  dfs1(0);
  a[0] = 0;
  memset(b, -1, sizeof(b));
  dfs(0);
  int z = run();
  if (z == 0)
    printf("No such line.\n");
  else {
    sta[top] = '\0';
    printf("%s\n", sta);
  }
}
