#include <bits/stdc++.h>
using namespace std;
struct $ {
  $() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
  }
} $;
int main() {
  string s;
  int k, l, sl = 0;
  cin >> s >> k;
  l = int(s.length());
  if (k > int64_t(l) * (l + 1) / 2) {
    cout << "No such line.\n";
    return 0;
  }
  vector<int> pos(l), nxt[26];
  iota(begin(pos), end(pos), 0);
  for (--k; k >= 0; (k -= int(pos.size())), ++sl) {
    for (int i = 0; i < 26; ++i) nxt[i].clear();
    for (int p : pos)
      if (p + sl < l) nxt[s[p + sl] - 'a'].emplace_back(p);
    for (int i = 0; i < 26; ++i) {
      int oldk = k;
      for (int p : nxt[i])
        if ((k -= l - p - sl) < 0) {
          k = oldk;
          pos = move(nxt[i]);
          cout << char('a' + i);
          goto reloop;
        }
    }
  reloop:;
  }
  cout << '\n';
  return 0;
}
