#include <bits/stdc++.h>
using namespace std;
char s[200000];
char res[100001];
int P[100000];
long long C[256];
long long k;
int main(void) {
  cin >> s;
  cin >> k;
  int m, n = 0;
  for (char *t = s; *t; t++, n++) P[n] = n;
  if ((long long)n * (n + 1) / 2 < k)
    cout << "No such line.";
  else {
    m = n;
    int pos;
    for (pos = 0; k > 0; pos++, k -= m) {
      fill(C + 'a', C + 'z' + 1, 0);
      for (int i = 0; i < m; i++) C[s[P[i]]] += n - P[i];
      char cs;
      for (cs = 'a'; cs <= 'z' && k > C[cs]; cs++) k -= C[cs];
      res[pos] = cs;
      int r = 0;
      for (int j = 0; j < m; j++) {
        if (s[P[j]] == cs) P[r++] = P[j] + 1;
      }
      m = r;
    }
    res[pos] = 0;
    cout << res;
  }
  return 0;
}
