#include <bits/stdc++.h>
using namespace std;
template <class T>
using vec = vector<T>;
template <typename Iter>
ostream &_IterOutput_(ostream &o, Iter b, Iter e, const string ss = "",
                      const string se = "") {
  o << ss;
  for (auto it = b; it != e; it++) o << (it == b ? "" : ", ") << *it;
  return o << se;
}
template <typename T1, typename T2>
ostream &operator<<(ostream &o, const pair<T1, T2> &pair) {
  return o << "(" << pair.first << ", " << pair.second << ")";
}
template <typename T>
ostream &operator<<(ostream &o, const vector<T> &vec) {
  return _IterOutput_(o, begin(vec), end(vec), "[", "]");
}
template <typename T>
ostream &operator<<(ostream &o, const set<T> &st) {
  return _IterOutput_(o, begin(st), end(st), "{", "}");
}
template <typename T, size_t N>
ostream &operator<<(ostream &o, const array<T, N> &arr) {
  return _IterOutput_(o, begin(arr), end(arr), "|", "|");
}
template <typename T1, typename T2>
ostream &operator<<(ostream &o, const map<T1, T2> &mp) {
  o << "{";
  for (auto it = mp.begin(); it != mp.end(); it++) {
    o << (it == mp.begin() ? "" : ", ") << it->first << ":" << it->second;
  }
  o << "}";
  return o;
}
const int MX = 101010;
struct SAM {
  struct State {
    int val;
    State *par;
    State *go[26];
    bool acc;
    State() : val(0), par(0), acc(0) { memset(go, 0, sizeof(go)); }
  } st[MX];
  State *root, *tail;
  int n;
  State *newState() {
    st[n] = State();
    return st + (n++);
  }
  void init(string s) {
    n = 0;
    tail = root = newState();
    for (auto c : s) extend(c - 'a');
    while (tail) {
      tail->acc = 1;
    }
  }
  void extend(int c) {
    auto p = tail;
    auto np = newState();
    np->val = p->val + 1;
    for (; p && !p->go[c]; p = p->par) p->go[c] = np;
    if (!p)
      np->par = root;
    else {
      auto q = p->go[c];
      if (q->val == p->val + 1)
        np->par = p->go[c];
      else {
        auto z = newState();
        *z = *q;
        z->val = p->val + 1;
        q->par = np->par = z;
        for (; p && p->go[c] == q; p = p->par) q->go[c] = z;
      }
    }
    tail = np;
  }
  bool us[MX];
  int mem[MX];
  int dp(State *s) {
    int id = s - root;
    if (us[id]) return mem[id];
    us[id] = 1;
    int &ans = mem[id];
    ans = s->acc;
    for (int i = 0; i < 26; i++) {
      if (s->go[i]) ans += dp(s->go[i]);
    }
    return ans;
  }
  void wlk(State *s, int k) {
    if (s->acc and !k) return;
    k -= s->acc;
    for (int i = 0; i < 26; i++) {
      if (!s->go[i]) continue;
      if (k < dp(s->go[i])) {
        cout << char('a' + i);
        wlk(s->go[i], k);
      } else {
        k -= dp(s->go[i]);
      }
    }
  }
} sam;
vector<int> zz[MX];
char ip[MX];
string s;
void go(int lv, int &k) {
  auto &vec = zz[lv];
  sort(begin(vec), end(vec), [&](int a, int b) { return s[a] < s[b]; });
  int nid = 0;
  while (nid < ((int)(vec).size())) {
    char nc = s[vec[nid]];
    ip[lv] = nc;
    while (k and nid < ((int)(vec).size()) and s[vec[nid]] == nc) {
      if (vec[nid] != ((int)(s).size()) - 1) {
        zz[lv + 1].push_back(vec[nid] + 1);
      }
      nid++;
      k--;
    }
    if (!k) {
      ip[lv + 1] = 0;
      cout << ip << endl;
      return;
    }
    go(lv + 1, k);
    zz[lv + 1].clear();
    if (!k) return;
  }
  if (!lv and k) cout << "No such line." << endl;
}
int32_t main() {
  do {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
  } while (0);
  int K;
  while (cin >> s >> K) {
    for (int i = 0; i < ((int)(s).size()); i++) {
      zz[0].push_back(i);
    }
    go(0, K);
    for (int i = 0; i < ((int)(s).size()) + 3; i++) zz[i].clear();
  }
  return 0;
}
