#include <bits/stdc++.h>
using namespace std;
namespace sa {
const int MAXN = 100005 << 1;
const int MAXC = 26;
char str[MAXN];
int n, sz, last;
int len[MAXN], link[MAXN], ed[MAXN][MAXC], cnt[MAXN];
bool terminal[MAXN];
vector<int> G[MAXN];
void init() {
  memset(ed[0], -1, sizeof(ed[0]));
  len[0] = 0, link[0] = -1, sz = 1, last = 0, terminal[0] = false;
}
inline int scale(char c) { return c - 'a'; }
void extend(char c) {
  int cur = sz++;
  terminal[cur] = false;
  cnt[cur] = 1;
  memset(ed[cur], -1, sizeof(ed[cur]));
  len[cur] = len[last] + 1;
  int p = last;
  while (p != -1 && ed[p][c] == -1) {
    ed[p][c] = cur;
    p = link[p];
  }
  if (p == -1)
    link[cur] = 0;
  else {
    int q = ed[p][c];
    if (len[p] + 1 == len[q])
      link[cur] = q;
    else {
      int clone = sz++;
      len[clone] = len[p] + 1;
      memcpy(ed[clone], ed[q], sizeof(ed[q]));
      link[clone] = link[q];
      while (p != -1 && ed[p][c] == q) {
        ed[p][c] = clone;
        p = link[p];
      }
      link[q] = link[cur] = clone;
      cnt[clone] = 0;
      terminal[clone] = false;
    }
  }
  last = cur;
}
void dfs(int s) {
  for (auto x : G[s]) dfs(x), cnt[s] += cnt[x];
}
long long dp[MAXN];
long long call(int nd) {
  long long &ret = dp[nd];
  int x;
  if (ret != -1) return ret;
  ret = cnt[nd];
  for (int i = 0; i < MAXC; i++) {
    x = ed[nd][i];
    if (x != -1) ret += call(x);
  }
  return ret;
}
string lex_kth_substr(long long k) {
  if ((k + k) > (n * (n + 1LL))) return "No such line.";
  string ret = "";
  int cur = 0, x;
  while (k > 0) {
    for (int i = 0; i < MAXC; i++) {
      x = ed[cur][i];
      if (x == -1) continue;
      if (call(x) >= k) {
        ret += (char)i + 'a';
        cur = x;
        k -= cnt[x];
        break;
      }
      k -= call(x);
    }
  }
  return ret;
}
void build() {
  init();
  n = strlen(str);
  for (int i = 0; i < n; i++) extend(scale(str[i]));
  for (int i = 1; i < sz; i++) G[link[i]].push_back(i);
  dfs(0);
  for (int i = 0; i < sz; i++) G[i].clear();
  for (int i = last; i != -1; i = link[i]) terminal[i] = true;
  memset(dp, -1, sizeof(dp));
}
}  // namespace sa
int main() {
  scanf("%s", sa::str);
  sa::build();
  int k;
  scanf("%d", &k);
  cout << sa::lex_kth_substr(k) << "\n";
  return 0;
}
