#include <bits/stdc++.h>
using namespace std;
struct node {
  int len;
  int link;
  int firstpos;
  map<char, int> nxt;
};
const int MX = 250000 * 2;
node t[MX];
int sz, last;
void init() {
  sz = last = 0;
  t[0].len = 0;
  t[0].firstpos = 0;
  t[0].link = -1;
  sz++;
}
long long cnt[MX];
vector<pair<int, int> > v;
set<pair<int, int> > nodes;
void add_letter(char ch) {
  int cur = sz++;
  t[cur].len = t[last].len + 1;
  t[cur].firstpos = t[cur].len;
  cnt[cur] = 1;
  nodes.insert({t[cur].len, cur});
  int p;
  for (p = last; p != -1 && !t[p].nxt.count(ch); p = t[p].link)
    t[p].nxt[ch] = cur;
  if (p == -1)
    t[cur].link = 0;
  else {
    int q = t[p].nxt[ch];
    if (t[p].len + 1 == t[q].len)
      t[cur].link = q;
    else {
      int clone = sz++;
      t[clone].len = t[p].len + 1;
      t[clone].nxt = t[q].nxt;
      t[clone].link = t[q].link;
      t[clone].firstpos = t[q].firstpos;
      cnt[clone] = 0;
      nodes.insert({t[clone].len, clone});
      for (; p != -1 && t[p].nxt[ch] == q; p = t[p].link) t[p].nxt[ch] = clone;
      t[q].link = t[cur].link = clone;
    }
  }
  last = cur;
}
int k;
string ans;
void kth_string(int u) {
  if (k <= 0) return;
  for (auto x : t[u].nxt) {
    k -= cnt[x.second];
    kth_string(x.second);
    if (k <= 0) {
      ans.push_back(x.first);
      break;
    }
  }
}
int main() {
  int i, j, n, m, q;
  string s;
  cin >> s;
  n = s.size();
  init();
  for (i = 0; i < n; i++) add_letter(s[i]);
  for (auto it = nodes.rbegin(); it != nodes.rend(); ++it)
    cnt[t[(*it).second].link] += cnt[(*it).second];
  cin >> k;
  kth_string(0);
  reverse(ans.begin(), ans.end());
  if (k > 0)
    cout << "No such line.\n";
  else
    cout << ans << endl;
  return 0;
}
