#include <bits/stdc++.h>
using ll = long long;
using namespace std;
string ans;
struct SuffixAutomaton {
  using ADJ = map<char, int>;
  vector<ADJ> edges;
  vector<long long> dp, dp2, isTerminal;
  vector<int> link, length;
  int last;
  SuffixAutomaton(string s) {
    edges.push_back(ADJ());
    link.push_back(-1);
    length.push_back(0);
    last = 0;
    for (int i = 0; i < ((int)(s).size()); ++i) {
      edges.push_back(ADJ());
      length.push_back(i + 1);
      link.push_back(0);
      int r = ((int)(edges).size()) - 1, p = last;
      while (p >= 0 && edges[p].find(s[i]) == edges[p].end()) {
        edges[p][s[i]] = r, p = link[p];
      }
      if (p != -1) {
        int q = edges[p][s[i]];
        if (length[p] + 1 == length[q])
          link[r] = q;
        else {
          edges.push_back(edges[q]);
          length.push_back(length[p] + 1);
          link.push_back(link[q]);
          int qq = ((int)(edges).size()) - 1;
          link[q] = qq;
          link[r] = qq;
          while (p >= 0 && edges[p][s[i]] == q) {
            edges[p][s[i]] = qq, p = link[p];
          }
        }
      }
      last = r;
    }
    dp.assign(edges.size(), -1);
    dp2.assign(edges.size(), -1);
    isTerminal.resize(edges.size());
    for (int p = last; p > 0; p = link[p]) isTerminal[p] = 1;
  }
  ll occ(int node) {
    ll &y = dp[node];
    if (y != -1) return y;
    y = isTerminal[node];
    for (auto &v : edges[node]) {
      y += occ(v.second);
    }
    return y;
  }
  ll numPaths(int node) {
    ll &y = dp2[node];
    if (y != -1) return y;
    y = occ(node);
    for (auto &v : edges[node]) {
      y += numPaths(v.second);
    }
    return y;
  }
  void compute(int node, int k) {
    if (k <= occ(node)) return;
    k -= occ(node);
    for (auto &v : edges[node]) {
      if (k > numPaths(v.second)) {
        k -= numPaths(v.second);
      } else {
        ans += v.first;
        compute(v.second, k);
        return;
      }
    }
  }
};
int main() {
  string s;
  cin >> s;
  SuffixAutomaton sa(s);
  int k;
  cin >> k;
  if (k > (((int)(s).size()) * 1ll * (((int)(s).size()) + 1)) / 2)
    cout << "No such line.\n";
  else {
    sa.compute(0, k + sa.occ(0));
    cout << ans << endl;
  }
  return 0;
}
