#include <bits/stdc++.h>
using namespace std;
const int key = 701;
const int Maxn = 100000 + 10;
int n, k;
int hsh[Maxn], t[Maxn];
string s;
void input();
void init();
void run();
void output();
struct compare {
  bool operator()(pair<int, int> a, pair<int, int> b) {
    int beg = 0, end = min(a.second, b.second) + 1;
    while (end - beg > 1) {
      int mid = (beg + end) / 2;
      if (hsh[a.first + mid] - hsh[a.first] * t[mid] ==
          hsh[b.first + mid] - hsh[b.first] * t[mid])
        beg = mid;
      else
        end = mid;
    }
    if (beg == a.second && b.second == beg) return a < b;
    if (beg == a.second) return 1;
    if (beg == b.second) return 0;
    return (s[a.first + beg] < s[b.first + beg]);
  }
};
set<pair<int, int>, compare> m;
int main() {
  input();
  init();
  run();
  output();
}
void input() {
  cin >> s;
  cin >> k;
  n = s.size();
}
void init() {
  for (int i = 1; i <= n; i++) hsh[i] = hsh[i - 1] * key + int(s[i - 1]);
  t[0] = 1;
  for (int i = 1; i <= n; i++) t[i] = t[i - 1] * key;
  for (int i = 0; i < n; i++) m.insert(make_pair(i, 1));
}
void run() {
  for (int i = 1; i < k && m.size() > 0; i++) {
    pair<int, int> f = *m.begin();
    m.erase(f);
    if (f.first + f.second + 1 <= n) m.insert(make_pair(f.first, f.second + 1));
  }
}
void output() {
  if (m.size() == 0) {
    cout << "No such line." << endl;
    return;
  }
  pair<int, int> f = *m.begin();
  for (int i = 0; i < f.second; i++) cout << s[i + f.first];
}
