#include <bits/stdc++.h>
using namespace std;
string second;
long long int sa[1000001], pos[1000001], tmp[1000001], lcp[1000001], N, gap,
    freq[1000001], t[4 * 1000001];
bool Sufcmp(int i, int j) {
  if (pos[i] != pos[j]) {
    return pos[i] < pos[j];
  }
  i += gap;
  j += gap;
  return (i < N && j < N) ? pos[i] < pos[j] : i > j;
}
void buildSA() {
  N = second.size();
  for (int i = 0; i < N; i++) {
    sa[i] = i;
    pos[i] = second[i];
  }
  tmp[0] = 0;
  for (gap = 1;; gap = (gap << 1)) {
    sort(sa, sa + N, Sufcmp);
    for (int i = 0; i < N - 1; i++)
      tmp[i + 1] = tmp[i] + Sufcmp(sa[i], sa[i + 1]);
    for (int i = 0; i < N; i++) pos[sa[i]] = tmp[i];
    if (tmp[N - 1] == N - 1) break;
  }
}
void buildLCP() {
  N = second.size();
  lcp[0] = 0;
  for (int i = 0, k = 0; i < N; i++) {
    if (pos[i] != N - 1) {
      for (int j = sa[pos[i] + 1]; second[i + k] == second[j + k];) k++;
      lcp[pos[i] + 1] = k;
      if (k) k--;
    }
  }
}
int main() {
  long long int i, j, n, l, mini;
  cin >> second;
  N = second.size();
  cin >> n;
  if (n > N * (N + 1) / 2) {
    cout << "No such line.";
    return 0;
  }
  buildSA();
  buildLCP();
  for (i = 0; i < N; i++) {
    if (i == 0)
      l = 1;
    else
      l = lcp[i] + 1;
    while (l <= N - sa[i]) {
      j = i;
      mini = 1000000000000;
      while (j < N && mini >= l) {
        n--;
        if (n == 0) {
          cout << second.substr(sa[i], l);
          return 0;
        }
        mini = min(mini, lcp[j + 1]);
        j++;
      }
      l++;
    }
  }
  return 0;
}
