#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100009;
char s[MAXN + 1];
int len[2 * MAXN], suf[2 * MAXN];
int last, nxt[2 * MAXN][26];
bool term[2 * MAXN];
long long tdp[2 * MAXN], wordcnt[2 * MAXN];
int sz;
void DFS(int it) {
  if (wordcnt[it] != 0) return;
  if (term[it]) tdp[it] = 1;
  wordcnt[it] = 1;
  for (int i = 0; i < 26; i++) {
    int tp = nxt[it][i];
    if (tp == -1) continue;
    DFS(tp);
    tdp[it] += tdp[tp];
    wordcnt[it] += wordcnt[tp];
  }
  wordcnt[it] += tdp[it] - 1;
}
string answ;
void DFSDP(int it, int rp) {
  rp -= tdp[it];
  if (rp <= 0) return;
  for (int i = 0; i < 26; i++) {
    int tp = nxt[it][i];
    if (tp == -1) continue;
    if (wordcnt[tp] >= rp) {
      answ.push_back(i + 'a');
      DFSDP(tp, rp);
      return;
    } else
      rp -= wordcnt[tp];
  }
  answ = "";
}
void UpdTerm(int pos) {
  while (pos != -1) {
    term[pos] = true;
    pos = suf[pos];
  }
}
int main() {
  scanf("%s", s);
  len[0] = 0;
  suf[0] = -1;
  last = 0;
  memset(nxt, -1, sizeof(nxt));
  for (int cc = 0; s[cc] != '\0'; cc++) {
    int c = s[cc] - 'a';
    int curr = ++sz;
    len[curr] = len[last] + 1;
    int p = last;
    for (; p != -1 && nxt[p][c] == -1; p = suf[p]) nxt[p][c] = curr;
    if (p == -1) {
      suf[curr] = 0;
    } else {
      int q = nxt[p][c];
      if (len[p] + 1 == len[q]) {
        suf[curr] = q;
      } else {
        int qq = ++sz;
        memcpy(nxt[qq], nxt[q], sizeof(nxt[q]));
        suf[qq] = suf[q];
        suf[curr] = suf[q] = qq;
        len[qq] = len[p] + 1;
        for (; p != -1 && nxt[p][c] == q; p = suf[p]) nxt[p][c] = qq;
      }
    }
    last = curr;
  }
  UpdTerm(last);
  DFS(0);
  int k;
  scanf("%d", &k);
  DFSDP(0, k + tdp[0]);
  if (answ.empty()) cout << "No such line.";
  cout << answ << endl;
  return 0;
}
