#include <bits/stdc++.h>
using namespace std;
long long _gcd(long long a, long long b) { return b == 0 ? a : _gcd(b, a % b); }
long long gcd(long long a, long long b) { return _gcd(abs(a), abs(b)); }
struct SuffixAutomaton {
  vector<map<char, long long>> nxt;
  vector<long long> slink;
  vector<long long> len;
  long long lstr;
  long long root;
  vector<bool> is_terminal;
  long long slen;
  vector<vector<long long>> slink_tree;
  SuffixAutomaton(const string& s) {
    slen = s.size();
    nxt.push_back(map<char, long long>());
    len.push_back(0);
    slink.push_back(-1);
    is_terminal.push_back(false);
    lstr = root = 0;
    for (long long i = 0; i < s.size(); i++) {
      nxt.push_back(map<char, long long>());
      len.push_back(i + 1);
      slink.push_back(0);
      is_terminal.push_back(false);
      long long r = nxt.size() - 1;
      long long p = lstr;
      while (p >= 0 && nxt[p].count(s[i]) == 0) {
        nxt[p][s[i]] = r;
        p = slink[p];
      }
      if (p != -1) {
        long long q = nxt[p][s[i]];
        if (len[p] + 1 == len[q]) {
          slink[r] = q;
        } else {
          nxt.push_back(nxt[q]);
          len.push_back(len[p] + 1);
          slink.push_back(slink[q]);
          is_terminal.push_back(false);
          long long ql = nxt.size() - 1;
          slink[q] = ql;
          slink[r] = ql;
          while (p >= 0 && nxt[p][s[i]] == q) {
            nxt[p][s[i]] = ql;
            p = slink[p];
          }
        }
      }
      lstr = r;
      if (i == s.size() - 1) {
        p = r;
        while (p >= 0) {
          is_terminal[p] = true;
          p = slink[p];
        }
      }
    }
  }
  bool is_substr(const string& s) {
    long long cur = root;
    for (long long i = 0; i < s.size(); i++) {
      if (nxt[cur].count(s[i]) == 0) return false;
      cur = nxt[cur][s[i]];
    }
    return true;
  }
  bool is_suffix(const string& s) {
    long long cur = root;
    for (long long i = 0; i < s.size(); i++) {
      if (nxt[cur].count(s[i]) == 0) return false;
      cur = nxt[cur][s[i]];
    }
    if (is_terminal[cur]) return true;
    return false;
  }
  void dfs_num_substr(long long v, long long* dp) {
    dp[v] = 1;
    for (pair<char, long long> ad : nxt[v]) {
      if (dp[ad.second] == -1) dfs_num_substr(ad.second, dp);
      dp[v] += dp[ad.second];
    }
  }
  long long num_substr() {
    long long dp[nxt.size()];
    memset(dp, -1, sizeof dp);
    dfs_num_substr(root, dp);
    return dp[root] - 1;
  }
  void dfs_kth_substr(long long v, long long* dp, long long* dp2) {
    dp[v] = 0, dp2[v] = 0;
    for (pair<char, long long> ad : nxt[v]) {
      if (dp[ad.second] == -1) dfs_kth_substr(ad.second, dp, dp2);
      dp[v] += dp[ad.second];
      dp2[v] += dp[ad.second] + dp2[ad.second];
    }
    if (is_terminal[v]) {
      dp[v]++, dp2[v]++;
    }
  }
  void retrieve_kth_substr(long long v, long long* dp, long long* dp2,
                           long long k, string& ans) {
    if (v != root) {
      if (dp[v] >= k) return;
      k -= dp[v];
    }
    for (pair<char, long long> ad : nxt[v]) {
      if (dp2[ad.second] >= k) {
        ans.push_back(ad.first);
        retrieve_kth_substr(ad.second, dp, dp2, k, ans);
        break;
      }
      k -= dp2[ad.second];
    }
  }
  string kth_substr(long long k) {
    long long dp[nxt.size()], dp2[nxt.size()];
    memset(dp, -1, sizeof dp), memset(dp, -1, sizeof dp2);
    dfs_kth_substr(root, dp, dp2);
    string ans;
    retrieve_kth_substr(root, dp, dp2, k, ans);
    return ans;
  }
  void dfs_num_matches(long long v, long long* dp) {
    dp[v] = 0;
    if (is_terminal[v]) dp[v] = 1;
    for (pair<char, long long> ad : nxt[v]) {
      if (dp[ad.second] == -1) dfs_num_matches(ad.second, dp);
      dp[v] += dp[ad.second];
    }
  }
  long long num_matches(const string& s) {
    long long cur = root;
    for (long long i = 0; i < s.size(); i++) {
      if (nxt[cur].count(s[i]) == 0) return 0;
      cur = nxt[cur][s[i]];
    }
    long long dp[nxt.size()];
    memset(dp, -1, sizeof dp);
    dfs_num_matches(cur, dp);
    return dp[cur];
  }
  void dfs_first_match(long long v, long long* dp) {
    dp[v] = 0;
    if (is_terminal[v]) dp[v] = 1;
    for (pair<char, long long> ad : nxt[v]) {
      if (dp[ad.second] == -1) {
        dfs_first_match(ad.second, dp);
        dp[v] = max(dp[v], dp[ad.second] + 1);
      }
    }
  }
  long long first_match(const string& s) {
    long long cur = root;
    for (long long i = 0; i < s.size(); i++) {
      if (nxt[cur].count(s[i]) == 0) return -1;
      cur = nxt[cur][s[i]];
    }
    long long dp[nxt.size()];
    memset(dp, -1, sizeof dp);
    dfs_first_match(cur, dp);
    return slen - (dp[cur] - 1) - s.size();
  }
  void dfs_all_matches(long long v, vector<long long>& ans) {
    if (slink_tree[v].size() == 0) ans.push_back(len[v]);
    for (long long ad : slink_tree[v]) {
      dfs_all_matches(ad, ans);
    }
  }
  vector<long long> all_matches(const string& s) {
    slink_tree = vector<vector<long long>>(slink.size());
    for (long long i = 0; i < slink.size(); i++) {
      if (slink[i] >= 0) slink_tree[slink[i]].push_back(i);
    }
    long long cur = root;
    for (long long i = 0; i < s.size(); i++) {
      if (nxt[cur].count(s[i]) == 0) return vector<long long>();
      cur = nxt[cur][s[i]];
    }
    vector<long long> ans;
    dfs_all_matches(cur, ans);
    for (long long i = 0; i < ans.size(); i++) {
      ans[i] -= s.size();
    }
    return ans;
  }
};
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  string s;
  cin >> s;
  SuffixAutomaton sa(s);
  long long k;
  cin >> k;
  string kth = sa.kth_substr(k);
  if (kth.size() > 0)
    cout << kth << "\n";
  else
    cout << "No such line."
         << "\n";
}
