#include <bits/stdc++.h>
using namespace std;
const int INFint = 2e9;
const long long INF = 2e18;
const int MOD = 1e9 + 7;
vector<long long> p_pow;
int p = 31;
void init(int n = 1000000) {
  p_pow.resize(n, 0);
  p_pow[0] = 1;
  for (int i = 1; i < p_pow.size(); i++) {
    p_pow[i] = (1ll * p_pow[i - 1] * p);
  }
}
struct Hash {
  int n;
  vector<long long> hash;
  Hash() { n = 0; }
  Hash(string s) {
    n = (int)s.size();
    hash.resize(n);
    for (int i = 0; i < n; i++) {
      hash[i] = (i ? 1ll * hash[i - 1] * p : 0);
      hash[i] += (1ll * (s[i] - 'a' + 1));
    }
  }
  long long get(int l, int r) {
    int len = r - l + 1;
    long long h1 = hash[r];
    if (l) h1 -= hash[l - 1] * p_pow[len];
    return h1;
  }
  long long getHash() { return hash[n - 1]; }
};
Hash hashs;
string s;
struct kek {
  int l, r;
  kek() { l = r = 0; }
  kek(int l, int r) : l(l), r(r) {}
};
bool operator<(const kek &a, const kek &b) {
  int len1 = a.r - a.l + 1;
  int len2 = b.r - b.l + 1;
  if (len1 < len2) {
    if (hashs.get(a.l, a.r) == hashs.get(b.l, b.l + len1 - 1)) return 1;
  }
  if (len1 > len2) {
    if (hashs.get(a.l, a.l + len2 - 1) == hashs.get(b.l, b.r)) return 0;
  }
  if (len1 == len2) {
    if (hashs.get(a.l, a.r) == hashs.get(b.l, b.r)) {
      if (a.l == b.l) return a.r < b.r;
      return a.l < b.l;
    }
  }
  int e = -1;
  int l = 0, r = min(len1, len2) - 1;
  while (l <= r) {
    int md = (l + r) / 2;
    if (hashs.get(a.l, a.l + md) == hashs.get(b.l, b.l + md)) {
      l = md + 1;
      e = md;
    } else {
      r = md - 1;
    }
  }
  if (a.l + e + 1 <= a.r && b.l + e + 1 <= b.r) {
    return s[a.l + e + 1] < s[b.l + e + 1];
  }
  return (a.l + e + 1 > a.r && b.l + e + 1 <= b.r);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin >> s;
  init();
  hashs = Hash(s);
  set<kek> all;
  for (int i = 0; i < s.size(); i++) {
    all.insert(kek(i, i));
  }
  int k;
  cin >> k;
  for (; k--;) {
    if (all.size() == 0) {
      cout << "No such line.";
      return 0;
    }
    kek x = *all.begin();
    if (k == 0) {
      for (int i = x.l; i <= x.r; i++) cout << s[i];
      return 0;
    }
    all.erase(all.begin());
    if (x.r + 1 < s.size()) {
      all.insert(kek(x.l, x.r + 1));
    }
  }
  cout << "No such line.";
  fprintf(stderr, "\nTIME = %lf\n", 1.0 * clock() / CLOCKS_PER_SEC);
  ;
  return 0;
}
