#include <bits/stdc++.h>
using namespace std;
const int kinds = 128, MAX = 100010;
char s[MAX];
int K, buc[MAX], r[MAX], sa[MAX], X[MAX], Y[MAX], high[MAX];
bool cmp(int *r, int a, int b, int x) {
  return (r[a] == r[b] && r[a + x] == r[b + x]);
}
void suffix(int n, int m) {
  int *x = X, *y = Y, i, j, k = 0, l;
  memset(buc, 0, sizeof(buc));
  for (i = 0; i < n; i++) buc[x[i] = s[i]]++;
  for (i = 1; i < m; i++) buc[i] += buc[i - 1];
  for (i = n - 1; i >= 0; i--) sa[--buc[x[i]]] = i;
  for (l = 1, j = 1; j < n; m = j, l <<= 1) {
    j = 0;
    for (i = n - l; i < n; i++) y[j++] = i;
    for (i = 0; i < n; i++)
      if (sa[i] >= l) y[j++] = sa[i] - l;
    for (i = 0; i < m; i++) buc[i] = 0;
    for (i = 0; i < n; i++) buc[x[y[i]]]++;
    for (i = 1; i < m; i++) buc[i] += buc[i - 1];
    for (i = n - 1; i >= 0; i--) sa[--buc[x[y[i]]]] = y[i];
    for (swap(x, y), x[sa[0]] = 0, i = 1, j = 1; i < n; i++)
      x[sa[i]] = cmp(y, sa[i - 1], sa[i], l) ? j - 1 : j++;
  }
  for (i = 1; i < n; i++) r[sa[i]] = i;
  for (i = 0; i < n - 1; high[r[i++]] = k)
    for (k ? k-- : 0, j = sa[r[i] - 1]; s[i + k] == s[j + k]; k++)
      ;
}
int Log[MAX], best[20][MAX];
void initRMQ(int n) {
  Log[0] = -1;
  for (int i = 1; i <= n; i++)
    Log[i] = (i & (i - 1)) ? Log[i - 1] : Log[i - 1] + 1;
  for (int i = 1; i <= n; i++) best[0][i] = high[i];
  for (int i = 1; i <= Log[n]; i++) {
    int limit = n - (1 << i) + 1;
    for (int j = 1; j <= limit; j++)
      best[i][j] = min(best[i - 1][j], best[i - 1][j + (1 << i >> 1)]);
  }
}
int lcp(int a, int b) {
  a = r[a];
  b = r[b];
  if (a > b) swap(a, b);
  a++;
  int t = Log[b - a + 1];
  return min(best[t][a], best[t][b - (1 << t) + 1]);
}
int main() {
  while (scanf("%s%d", s, &K) == 2) {
    int len = strlen(s);
    if (K > (long long)(len) * (len + 1) / 2) {
      puts("No such line.");
      continue;
    }
    suffix(len + 1, kinds);
    initRMQ(len);
    while (K > 0) {
      for (int i = 1; i <= len; i++) {
        for (int j = 1 + high[i]; j <= len - sa[i]; j++) {
          int k = i + 1;
          while (k <= len && lcp(sa[i], sa[k]) >= j) {
            k++;
          }
          K -= (k - i);
          if (K <= 0) {
            for (int ans = sa[i]; ans < sa[i] + j; ans++) printf("%c", s[ans]);
            puts("");
            break;
          }
        }
        if (K <= 0) break;
      }
    }
  }
  return 0;
}
