#include <bits/stdc++.h>
using namespace std;
char T[100010];
int n;
int RA[100010], tempRA[100010];
int SA[100010], tempSA[100010];
int c[100010];
void countingSort(int k) {
  int i, sum, maxi = max(300, n);
  memset(c, 0, sizeof c);
  for (i = 0; i < n; i++) c[i + k < n ? RA[i + k] : 0]++;
  for (i = sum = 0; i < maxi; i++) {
    int t = c[i];
    c[i] = sum;
    sum += t;
  }
  for (i = 0; i < n; i++)
    tempSA[c[SA[i] + k < n ? RA[SA[i] + k] : 0]++] = SA[i];
  for (i = 0; i < n; i++) SA[i] = tempSA[i];
}
void constructSA() {
  int i, k, r;
  for (i = 0; i < n; i++) RA[i] = T[i];
  for (i = 0; i < n; i++) SA[i] = i;
  for (k = 1; k < n; k <<= 1) {
    countingSort(k);
    countingSort(0);
    tempRA[SA[0]] = r = 0;
    for (i = 1; i < n; i++)
      tempRA[SA[i]] =
          (RA[SA[i]] == RA[SA[i - 1]] && RA[SA[i] + k] == RA[SA[i - 1] + k])
              ? r
              : ++r;
    for (i = 0; i < n; i++) RA[i] = tempRA[i];
    if (RA[SA[n - 1]] == n - 1) break;
  }
}
int Phi[100010];
int PLCP[100010];
int LCP[100010];
void computeLCP() {
  int i, L;
  Phi[SA[0]] = -1;
  for (i = 1; i < n; i++) Phi[SA[i]] = SA[i - 1];
  for (i = L = 0; i < n; i++) {
    if (Phi[i] == -1) {
      PLCP[i] = 0;
      continue;
    }
    while (T[i + L] == T[Phi[i] + L]) L++;
    PLCP[i] = L;
    L = max(L - 1, 0);
  }
  for (i = 0; i < n; i++) LCP[i] = PLCP[SA[i]];
}
int main() {
  n = (int)strlen(gets(T));
  long long v = n;
  T[n++] = '$';
  long long k;
  cin >> k;
  if (k > (v * (v - 1) / 2) + v) {
    cout << "No such line.";
  }
  constructSA();
  computeLCP();
  int r = 0;
  int a[100000 + 2];
  memset(a, 0, sizeof a);
  for (int i = 1; i < n; i++) {
    for (int j = a[i]; j + SA[i] < n - 1; j++) {
      int l = i;
      while (true) {
        r++;
        a[l]++;
        if (r == k) {
          for (int k = SA[l]; k <= SA[l] + j; k++) cout << T[k];
          return 0;
        }
        if (l < n - 1 && LCP[l + 1] >= j + 1) {
          l++;
        } else
          break;
      }
    }
  }
}
