#include <bits/stdc++.h>
using std::bitset;
using std::cin;
using std::cout;
using std::deque;
using std::endl;
using std::getline;
using std::greater;
using std::lower_bound;
using std::make_pair;
using std::map;
using std::max;
using std::min;
using std::multimap;
using std::multiset;
using std::pair;
using std::priority_queue;
using std::queue;
using std::random_shuffle;
using std::set;
using std::sort;
using std::stack;
using std::string;
using std::stringstream;
using std::swap;
using std::unique;
using std::upper_bound;
using std::vector;
const int MAXN(100010);
const int MAXM(55);
const int MAXE(200010);
const int MAXK(6);
const int HSIZE(13131);
const int SIGMA_SIZE(26);
const int MAXH(20);
const int INFI((INT_MAX - 1) >> 1);
const unsigned long long BASE(31);
const long long LIM(1e13);
const int INV(-10000);
const int MOD((1 << 30) - 1);
const double EPS(1e-7);
const long double PI(acos(-1.0));
template <typename T>
inline void checkmax(T &a, T b) {
  if (b > a) a = b;
}
template <typename T>
inline void checkmin(T &a, T b) {
  if (b < a) a = b;
}
template <typename T>
inline T ABS(const T &a) {
  return a < 0 ? -a : a;
}
struct NODE {
  int len, ri;
  NODE *f, *ch[SIGMA_SIZE];
};
int cnt[MAXN], rec[MAXN << 1];
struct SAM {
  NODE pool[MAXN << 1];
  NODE *root, *last;
  int size;
  void init() {
    last = root = pool;
    root->len = 0;
    root->f = 0;
    memset(root->ch, 0, sizeof(root->ch));
    size = 1;
  }
  void extend(int c) {
    NODE *p = last, *np = pool + size++;
    memset(np->ch, 0, sizeof(np->ch));
    np->len = last->len + 1;
    np->ri = 1;
    last = np;
    while (p && p->ch[c] == 0) {
      p->ch[c] = np;
      p = p->f;
    }
    if (p == 0)
      np->f = root;
    else {
      NODE *q = p->ch[c];
      if (q->len == p->len + 1)
        np->f = q;
      else {
        NODE *nq = pool + size++;
        nq->len = p->len + 1;
        memcpy(nq->ch, q->ch, sizeof(nq->ch));
        nq->ri = 0;
        nq->f = q->f;
        q->f = np->f = nq;
        while (p && p->ch[c] == q) {
          p->ch[c] = nq;
          p = p->f;
        }
      }
    }
  }
  void topo() {
    int l = last->len;
    memset(cnt, 0, sizeof(cnt[0]) * (l + 1));
    for (int i = 0; i < size; ++i) ++cnt[pool[i].len];
    for (int i = 1; i <= l; ++i) cnt[i] += cnt[i - 1];
    for (int i = 0; i < size; ++i) rec[--cnt[pool[i].len]] = i;
  }
  void process() {
    for (int i = size - 1; i > 0; --i) pool[rec[i]].f->ri += pool[rec[i]].ri;
  }
} sam;
char ans[MAXN];
int rk;
void dfs(int dep, NODE *p) {
  if (rk <= 0) {
    ans[dep] = '\0';
    printf("%s\n", ans);
    throw true;
  }
  for (int i = 0; i < SIGMA_SIZE; ++i)
    if (p->ch[i]) {
      rk -= p->ch[i]->ri;
      ans[dep] = 'a' + i;
      dfs(dep + 1, p->ch[i]);
    }
}
char str[MAXN];
int main() {
  while (~scanf("%s", str)) {
    scanf("%d", &rk);
    long long len = strlen(str);
    if (rk > len * (len + 1) / 2) {
      printf("No such line.\n");
      continue;
    }
    sam.init();
    for (char *sp = str; *sp; ++sp) sam.extend(*sp - 'a');
    sam.topo();
    sam.process();
    try {
      dfs(0, sam.root);
      printf("No such line.\n");
    } catch (bool) {
    }
  }
  return 0;
}
