#include <bits/stdc++.h>
using namespace std;
class suffixauto {
 public:
  suffixauto(const string &s = "") { build(s); }
  struct node {
    long long link, length;
    bool terminal;
    map<char, long long> edges;
    node(long long lnk = -1, long long len = 0,
         map<char, long long> m = map<char, long long>()) {
      link = lnk;
      length = len;
      edges = m;
      terminal = false;
    }
  };
  vector<node> nodes;
  vector<long long> occurences, words;
  size_t createNewNode(long long link = -1, long long len = 0,
                       map<char, long long> m = map<char, long long>()) {
    nodes.push_back(node(link, len, m));
    return nodes.size() - 1;
  }
  void build(const string &s) {
    nodes.clear();
    nodes.reserve(2 * s.size() + 1);
    createNewNode();
    long long last = 0;
    for (long long i = 0; i < s.size(); i++) {
      long long r = createNewNode(0, i + 1);
      long long p = last;
      while (!(p == -1 || nodes[p].edges.count(s[i]))) {
        nodes[p].edges[s[i]] = r;
        p = nodes[p].link;
      }
      if (p != -1) {
        long long q = nodes[p].edges[s[i]];
        if ((nodes[p].length + 1) == nodes[q].length) {
          nodes[r].link = q;
        } else {
          long long qnew =
              createNewNode(nodes[q].link, nodes[p].length + 1, nodes[q].edges);
          nodes[r].link = qnew;
          nodes[q].link = qnew;
          while (p != -1 && nodes[p].edges[s[i]] == q) {
            nodes[p].edges[s[i]] = qnew;
            p = nodes[p].link;
          }
        }
      }
      last = r;
    }
    while (last > 0) {
      nodes[last].terminal = true;
      last = nodes[last].link;
    }
    occurences.assign(nodes.size(), 0);
    words.assign(nodes.size(), 0);
  }
  long long iterate(long long loc = 0) {
    if (occurences[loc]) return occurences[loc];
    if (nodes[loc].terminal) occurences[loc] = 1;
    for (auto &i : nodes[loc].edges) {
      occurences[loc] += iterate(i.second);
    }
    return occurences[loc];
  }
  long long getans(long long k, string &ans, long long loc = 0) {
    if (words[loc]) {
      if (words[loc] >= k) {
        long long lel = occurences[loc];
        if (k <= lel) return lel;
        for (auto &i : nodes[loc].edges) {
          lel += getans(k - lel, ans, i.second);
          if (k <= lel) {
            ans.push_back(i.first);
            return lel;
          }
        }
      }
      return words[loc];
    } else {
      words[loc] = occurences[loc];
      if (k <= words[loc]) return words[loc];
      for (auto &i : nodes[loc].edges) {
        words[loc] += getans(k - words[loc], ans, i.second);
        if (k <= words[loc]) {
          ans.push_back(i.first);
          return words[loc];
        }
      }
      return words[loc];
    }
  }
  bool check(string &s) {
    long long idx = 0;
    for (auto &i : s) {
      if (!nodes[idx].edges.count(i)) return false;
      idx = nodes[idx].edges[i];
    }
    return true;
  }
};
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long k;
  string s, ans;
  cin >> s >> k;
  suffixauto a(s);
  a.iterate();
  a.occurences[0] = 0;
  a.getans(k, ans);
  reverse(ans.begin(), ans.end());
  if (ans.size())
    cout << ans;
  else
    cout << "No such line.";
  return 0;
}
