#include <bits/stdc++.h>
using namespace std;
string s;
long long last[130], pred[2000020];
int k;
char cc;
long long mm, m, t, a[2000020], aa[2000020], j;
char b[210000];
int main() {
  cin >> s >> k;
  int n = s.size();
  s = "$" + s;
  memset(last, 0, sizeof(last));
  for (int i = 1; i <= n; i++) {
    pred[i] = last[s[i]];
    last[s[i]] = i;
  }
  cc = '$';
  if ((1LL * (n) * (n + 1)) / 2LL < k) {
    cout << "No such line." << endl;
    return 0;
  }
  for (char ch = 'a'; ch <= 'z'; ch++) {
    t = 0;
    j = last[ch];
    while (j != 0) {
      t += (n - j + 1);
      if (t >= k) break;
      j = pred[j];
    }
    if (t >= k) {
      cout << ch;
      cc = ch;
      break;
    }
    k -= t;
  }
  j = last[cc];
  while (j != 0) {
    m++;
    a[m] = j;
    j = pred[j];
  }
  for (int len = 2; len <= n; len++) {
    if (k <= m) break;
    k -= m;
    memset(last, 0, sizeof(last));
    for (int i = 1; i <= m; i++) {
      if ((a[i] + len - 1) <= n) {
        b[i] = s[a[i] + len - 1];
        pred[i] = last[b[i]];
        last[b[i]] = i;
      } else
        b[i] = '$';
    }
    cc = '$';
    for (char ch = 'a'; ch <= 'z'; ch++) {
      t = 0;
      j = last[ch];
      while (j != 0) {
        t += (n - a[j] - len + 2);
        if (t >= k) break;
        j = pred[j];
      }
      if (t >= k) {
        cout << ch;
        cc = ch;
        break;
      }
      k -= t;
    }
    mm = 0;
    for (int i = 1; i <= m; i++)
      if (s[a[i] + len - 1] == cc) {
        mm++;
        aa[mm] = a[i];
      }
    m = mm;
    for (int i = 1; i <= mm; i++) a[i] = aa[i];
  }
  return 0;
}
