#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100000 + 10;
struct node {
  node *ch[26], *fa, *nxt;
  int go[26];
  long long val, cnt;
  long long dp;
  void clean() { memset(this, 0, sizeof(node)); }
} pool[MAXN * 2], *first[MAXN];
node *root, *last, *cur;
inline void init() {
  cur = pool;
  root = last = cur++;
}
node *p, *q, *nq;
inline void extend(int c) {
  p = last, last = cur++;
  last->val = p->val + 1;
  last->cnt = 1;
  while (p && !p->ch[c]) p->ch[c] = last, p = p->fa;
  if (!p) {
    last->fa = root;
    return;
  }
  q = p->ch[c];
  if (q->val == p->val + 1)
    last->fa = q;
  else {
    nq = cur++;
    memcpy(nq->ch, q->ch, sizeof(q->ch));
    nq->val = p->val + 1, nq->fa = q->fa;
    q->fa = last->fa = nq;
    while (p && p->ch[c] == q) p->ch[c] = nq, p = p->fa;
  }
}
char str[MAXN];
int main() {
  init();
  scanf("%s", str);
  long long L = strlen(str);
  for (int i = 0; str[i]; i++) extend(str[i] - 'a');
  for (node *i = pool; i != cur; i++) i->nxt = first[i->val], first[i->val] = i;
  for (int it = L; it >= 0; it--)
    for (node *i = first[it]; i; i = i->nxt)
      if (i->fa) i->fa->cnt += i->cnt;
  for (int it = L; it >= 0; it--)
    for (node *i = first[it]; i; i = i->nxt) {
      i->dp = i->cnt;
      for (int j = 0, top = 0; j < 26; j++)
        if (i->ch[j]) {
          i->dp += i->ch[j]->dp;
          i->go[top++] = j;
        }
    }
  int n;
  int t;
  n = 1;
  for (int i = 0; i < n; i++) {
    scanf("%d", &t);
    node *now = root;
    if (t > L * (L + 1) / 2) {
      puts("No such line.");
      continue;
    }
    while (t > 0) {
      for (int i = 0;; i++) {
        int u = now->go[i];
        if (now->ch[u]->dp >= t) {
          putchar(u + 'a');
          now = now->ch[u];
          t -= now->cnt;
          break;
        } else
          t -= now->ch[u]->dp;
      }
    }
    puts("");
  }
}
