#include <bits/stdc++.h>
using namespace std;
int ini() {
  int a;
  scanf("%d", &a);
  return a;
}
char inc() {
  char a;
  scanf("%c", &a);
  return a;
}
void readln() { scanf("\n"); }
int n, m, mm, p[111222];
long long cnt[26];
char s[111222], res[111222];
int main() {
  if (0) {
    freopen("aaa.inp", "r", stdin);
    freopen("aaa.out", "w", stdout);
  };
  gets(s);
  int n = strlen(s), k = ini();
  if (k > (long long)n * (n + 1) / 2) {
    cout << "No such line." << endl;
    return 0;
  }
  for (int i = 0; i < (int)n; i++) p[i] = i;
  m = n;
  for (int l = 0; l < (int)n; l++) {
    memset(cnt, 0, sizeof(cnt));
    for (int i = 0; i < (int)m; i++) cnt[s[p[i]] - 'a'] += n - p[i];
    for (int i = 0; i < (int)26; i++)
      if (k <= cnt[i]) {
        res[l] = i + 'a';
        break;
      } else
        k -= cnt[i];
    mm = 0;
    for (int i = 0; i < (int)m; i++)
      if (s[p[i]] == res[l]) p[mm++] = p[i] + 1;
    m = mm;
    if (k <= m) {
      cout << res << endl;
      return 0;
    }
    k -= m;
  }
  return 0;
};
