#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::ios;
using std::lower_bound;
using std::make_heap;
using std::make_pair;
using std::map;
using std::max;
using std::min;
using std::multimap;
using std::multiset;
using std::pair;
using std::pop_heap;
using std::priority_queue;
using std::push_heap;
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(310);
const int MAXE(310);
const int MAXK(6);
const int HSIZE(131313);
const int SIGMA_SIZE(26);
const int MAXH(18);
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(1000000007);
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;
}
char str[MAXN];
struct NODE {
  long long cnt;
  int ri, len;
  NODE *f, *ch[SIGMA_SIZE];
};
struct SAM {
  NODE pool[MAXN << 1], *root, *last, *rear;
  void init() {
    root = last = pool;
    root->cnt = root->ri = root->len = 0;
    root->f = 0;
    memset(root->ch, 0, sizeof(root->ch));
    rear = pool + 1;
  }
  void extend(int id) {
    NODE *p = last, *np = rear++;
    np->len = p->len + 1;
    np->ri = 1;
    np->cnt = 0;
    memset(np->ch, 0, sizeof(np->ch));
    last = np;
    while (p && p->ch[id] == 0) {
      p->ch[id] = np;
      p = p->f;
    }
    if (!p)
      np->f = root;
    else {
      NODE *q = p->ch[id];
      if (q->len == p->len + 1)
        np->f = q;
      else {
        NODE *nq = rear++;
        nq->ri = 0;
        nq->len = p->len + 1;
        nq->cnt = 0;
        memcpy(nq->ch, q->ch, sizeof(nq->ch));
        nq->f = q->f;
        q->f = np->f = nq;
        while (p && p->ch[id] == q) {
          p->ch[id] = nq;
          p = p->f;
        }
      }
    }
  }
  int buc[MAXN], size;
  NODE *rec[MAXN << 1];
  void tupo() {
    int tlen = last->len;
    size = rear - pool;
    memset(buc, 0, sizeof(buc[0]) * (tlen + 1));
    for (NODE *p = pool; p < rear; ++p) ++buc[p->len];
    for (int i = 1; i <= tlen; ++i) buc[i] += buc[i - 1];
    for (NODE *p = rear - 1; p >= pool; --p) rec[--buc[p->len]] = p;
  }
  void solve() {
    tupo();
    for (int i = size - 1; i > 0; --i) {
      NODE *p = rec[i];
      p->f->ri += p->ri;
      p->cnt = p->ri;
      for (int i = 0; i < SIGMA_SIZE; ++i)
        if (p->ch[i]) p->cnt += p->ch[i]->cnt;
    }
  }
} sam;
bool dfs(NODE *p, int rk, int dep) {
  if (rk <= 0) {
    str[dep] = '\0';
    printf("%s\n", str);
    return true;
  }
  for (int i = 0; i < SIGMA_SIZE; ++i)
    if (p->ch[i]) {
      if (rk > p->ch[i]->cnt)
        rk -= p->ch[i]->cnt;
      else {
        str[dep] = 'a' + i;
        return dfs(p->ch[i], rk - p->ch[i]->ri, dep + 1);
      }
    }
  return false;
}
int main() {
  scanf("%s", str);
  sam.init();
  for (char *sp = str; *sp; ++sp) sam.extend(*sp - 'a');
  sam.solve();
  int rk;
  scanf("%d", &rk);
  if (!dfs(sam.root, rk, 0)) printf("No such line.\n");
  return 0;
}
