#include <bits/stdc++.h>
using namespace std;
const int maxn = 110000;
int n, k;
char a[maxn];
template <int maxn>
struct Theap {
  int n;
  struct Tsqy {
    int l, r;
    inline void build(int a1, int a2) {
      l = a1;
      r = a2;
    }
    inline bool operator>(const Tsqy &y) const {
      const Tsqy &x = *this;
      for (int l = x.l, r = y.l; l <= x.r && r <= y.r; ++l, ++r)
        if (a[l] != a[r]) return a[l] > a[r];
      return x.r - x.l > y.r - y.l;
    }
  } h[maxn];
  inline static bool cmp_h(const Tsqy &x, const Tsqy &y) { return x > y; }
  inline void pop() {
    pop_heap(h + 1, h + n + 1, cmp_h);
    --n;
  }
  inline void push(int a1, int a2) {
    h[++n].build(a1, a2);
    push_heap(h + 1, h + n + 1, cmp_h);
  }
};
Theap<maxn * 2> heap;
namespace Ninit {
void init() {
  scanf("%s", a + 1);
  n = strlen(a + 1);
  cin >> k;
}
}  // namespace Ninit
namespace Nsolve {
void solve() {
  long long tot = (long long)n * (n + 1) / 2;
  if (k > tot) {
    cout << "No such line." << endl;
    return;
  }
  for (register int i = (1); i <= (n); ++i) heap.push(i, i);
  for (register int i = (1); i <= (k - 1); ++i) {
    Theap<maxn * 2>::Tsqy u = heap.h[1];
    heap.pop();
    if (u.r != n) heap.push(u.l, u.r + 1);
  }
  for (register int i = (heap.h[1].l); i <= (heap.h[1].r); ++i)
    printf("%c", a[i]);
  printf("\n");
}
}  // namespace Nsolve
int main() {
  Ninit::init();
  Nsolve::solve();
}
