#include <bits/stdc++.h>
using namespace std;
template <class T, class IT>
inline void PRINT(IT i1, IT i2) {
  cout << '[';
  copy(i1, i2, ostream_iterator<T>(cout, ", "));
  cout << "]\n";
}
void build_suffix_array(const string& str, vector<int>& sa) {
  size_t N = str.size();
  size_t AL = 256;
  sa.resize(N);
  vector<int> buck(max(AL, N));
  vector<int> c(N);
  vector<int> buf(N);
  fill(buck.begin(), buck.end(), 0);
  for (int i = 0; i < N; ++i) ++buck[str[i]];
  for (int i = 1; i < AL; ++i) buck[i] = buck[i] + buck[i - 1];
  for (int i = N - 1; i >= 0; --i) sa[--buck[str[i]]] = i;
  int colours = 1;
  c[sa[0]] = colours - 1;
  for (int i = 1; i < N; ++i)
    if (str[sa[i - 1]] != str[sa[i]])
      c[sa[i]] = colours++;
    else
      c[sa[i]] = colours - 1;
  for (int l = 1; l < N; l = l << 1) {
    for (int i = 0; i < N; ++i) buf[i] = (sa[i] - l + N) % N;
    fill(buck.begin(), buck.end(), 0);
    for (int i = 0; i < N; ++i) {
      ++buck[c[i]];
    }
    for (int i = 1; i < buck.size(); ++i) buck[i] = buck[i] + buck[i - 1];
    for (int i = N - 1; i >= 0; --i) {
      sa[--buck[c[buf[i]]]] = buf[i];
    }
    colours = 1;
    buf[sa[0]] = colours - 1;
    for (int i = 1; i < N; ++i)
      if (c[sa[i]] != c[sa[i - 1]] ||
          c[(sa[i] + l) % N] != c[(sa[i - 1] + l) % N])
        buf[sa[i]] = colours++;
      else
        buf[sa[i]] = colours - 1;
    c = buf;
  }
}
struct immutable_string {
  const char* str;
  size_t size;
  immutable_string() : str(0), size(0) {}
  explicit immutable_string(const char* s) : str(s), size(strlen(str)) {}
  immutable_string(const char* s, size_t len) : str(s), size(len) {}
};
bool prfx_lss1(const immutable_string& a, const immutable_string& b) {
  return strncmp(a.str, b.str, a.size) < 0;
}
bool prfx_lss2(const immutable_string& a, const immutable_string& b) {
  return strncmp(a.str, b.str, b.size) < 0;
}
pair<vector<immutable_string>::const_iterator,
     vector<immutable_string>::const_iterator>
find_rng(const vector<immutable_string>::const_iterator& from,
         const vector<immutable_string>::const_iterator& to,
         const immutable_string& str) {
  return make_pair(lower_bound(from, to, str, prfx_lss2),
                   upper_bound(from, to, str, prfx_lss1));
}
int main() {
  string str;
  char buf[100100];
  int n, k;
  cin >> buf >> k;
  n = strlen(buf);
  if (k > (long long)n * (n + 1) / 2) {
    cout << "No such line.\n";
    return 0;
  }
  str = buf;
  str.push_back('\0');
  vector<int> sa;
  build_suffix_array(str, sa);
  vector<immutable_string> cop(sa.size());
  for (int i = 0; i < cop.size(); ++i)
    cop[i] = immutable_string(&(str.c_str()[sa[i]]), n - sa[i]);
  vector<long long> sum(sa.size() + 1);
  sum[0] = 0;
  for (int i = 0; i < (int)(sa.size()); ++i) sum[i + 1] = sum[i] + (n - sa[i]);
  char result[100100];
  fill_n(result, 100100 - 1, 0);
  int current = 0;
  bool debug = false;
  while (k > 0) {
    for (int ch = (int)('a'); ch < (int)('z' + 1); ++ch) {
      result[current] = ch;
      pair<vector<immutable_string>::const_iterator,
           vector<immutable_string>::const_iterator>
          fe = find_rng(cop.begin(), cop.end(),
                        immutable_string(result, current + 1));
      if ((fe.first != fe.second) &&
          (strncmp((fe.first)->str, result, current + 1) == 0)) {
        if (debug && current > 100)
          cout << (fe.second - fe.first) << " "
               << sum[fe.second - cop.begin()] - sum[fe.first - cop.begin()]
               << '\n';
        long long suffix_count = fe.second - fe.first;
        long long substring_count = sum[fe.second - cop.begin()] -
                                    sum[fe.first - cop.begin()] -
                                    suffix_count * current;
        if (k <= suffix_count) {
          cout << result << endl;
          return 0;
        } else if (k <= substring_count) {
          if (suffix_count == 1) {
            strncpy(result + current + 1, fe.first->str + current + 1, k - 1);
            cout << result << '\n';
            return 0;
          } else {
            k -= suffix_count;
            ++current;
          }
          break;
        } else {
          k -= substring_count;
        }
      }
    }
    if (debug && (current > 100)) {
      cout << current << " " << result << " " << k << '\n';
    }
  }
  cout << result << '\n';
  return 0;
}
