#include <bits/stdc++.h>
using namespace std;
char s[100010], an[100010];
int len, d[100010], ann;
int main() {
  int i, j, k, n, x = 0, dn;
  gets(s);
  len = strlen(s);
  scanf("%d", &n);
  if (n > (long long)len * (len + 1) / 2) {
    puts("No such line.");
    return 0;
  }
  for (i = 0; i < len; i++) d[i] = i;
  dn = len;
  while (1) {
    long long alpha[26] = {};
    int num[26] = {};
    for (i = 0; i < dn; i++) {
      alpha[s[d[i] + x] - 'a'] += len - d[i] - x;
      num[s[d[i] + x] - 'a']++;
    }
    for (i = 0; i < 26; i++) {
      if (n <= alpha[i]) {
        an[ann++] = i + 'a';
        if (n <= num[i]) {
          puts(an);
          return 0;
        } else {
          n -= num[i];
          int ddn = 0;
          for (j = 0; j < dn; j++)
            if (s[d[j] + x] == i + 'a' && s[d[j] + x + 1]) d[ddn++] = d[j];
          x++;
          dn = ddn;
          break;
        }
      } else
        n -= alpha[i];
    }
  }
  return 0;
}
