#include <bits/stdc++.h>
using namespace std;
int n, m;
int i, j, k, l;
const int N = 2e5 + 5;
int len[N], d;
int link[N];
int to[N][26];
long long cnt[N], sz[N];
char s[N];
int a[N];
bool cmp_st(int i, int j) { return len[i] < len[j]; }
void dfs_cnt(int v) {
  cnt[v] = sz[v];
  for (int i = 0; i < 26; ++i)
    if (to[v][i]) {
      int u = to[v][i];
      if (!cnt[u]) dfs_cnt(u);
      cnt[v] += cnt[u];
    }
}
int main() {
  gets(s);
  n = strlen(s);
  d = 1;
  link[0] = -1;
  sz[0] = 1;
  int l = 0, p, q, cur;
  for (i = 0; i < n; ++i) {
    char c = s[i] - 'a';
    cur = d++;
    len[cur] = len[l] + 1;
    link[cur] = 0;
    sz[cur] = 1;
    for (; l != -1 && to[l][c] == 0; l = link[l]) to[l][c] = cur;
    if (l >= 0) {
      p = to[l][c];
      if (len[p] == len[l] + 1)
        link[cur] = p;
      else {
        q = d++;
        len[q] = len[l] + 1;
        link[q] = link[p];
        sz[q] = 0;
        memcpy(to[q], to[p], sizeof(to[p]));
        for (; l != -1 && to[l][c] == p; l = link[l]) to[l][c] = q;
        link[cur] = link[p] = q;
      }
    }
    l = cur;
  }
  for (i = 0; i < d; ++i) a[i] = i;
  sort(a, a + d, cmp_st);
  for (i = d - 1; i > 0; --i) sz[link[a[i]]] += sz[a[i]];
  dfs_cnt(0);
  long long K;
  scanf("%I64d", &K);
  K += n + 1;
  i = 0;
  m = 0;
  for (; K > 0;) {
    if (K <= sz[i]) {
      break;
    }
    K -= sz[i];
    for (j = 0; j < 26; ++j)
      if (to[i][j]) {
        if (cnt[to[i][j]] < K) {
          K -= cnt[to[i][j]];
        } else {
          s[m++] = j + 'a';
          i = to[i][j];
          break;
        }
      }
    if (j == 26) {
      puts("No such line.");
      return 0;
    }
  }
  s[m] = 0;
  puts(s);
  return 0;
}
