#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("O3")
#pragma comment(linker, "/STACK:32505856")
template <class T>
inline T sqr(T a) {
  return a * a;
}
template <class T>
inline void gmin(T &a, T b) {
  if (a > b) a = b;
}
template <class T>
inline void gmax(T &a, T b) {
  if (a < b) a = b;
}
inline int dcmp(const double &a) { return a > 1e-8 ? 1 : (a < -1e-8 ? -1 : 0); }
struct Initializer {
  Initializer() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
  }
} initializer;
struct SAM {
  int tot, last;
  int go[100010 << 1][26], pre[100010 << 1], step[100010 << 1];
  int din[100010 << 1];
  long long size[100010 << 1], same[100010 << 1];
  inline void new_node(int s) {
    step[++tot] = s;
    pre[tot] = size[tot] = 0;
    same[tot] = 1;
    memset(go[tot], 0, sizeof(go[tot]));
  }
  inline void build(char *s) {
    tot = 0, last = 1;
    new_node(0);
    for (; *s; s++) {
      new_node(step[last] + 1);
      int c = *s - 'a';
      int p = last, np = tot, q, nq;
      for (; p && !go[p][c]; p = pre[p]) go[p][c] = np;
      if (!p)
        pre[np] = 1;
      else {
        q = go[p][c];
        if (step[q] == step[p] + 1)
          pre[np] = q;
        else {
          new_node(step[p] + 1), nq = tot;
          for (int j = 0; j <= 25; j++) go[nq][j] = go[q][j];
          pre[nq] = pre[q];
          pre[np] = pre[q] = nq;
          same[nq] = 0;
          for (; p && go[p][c] == q; p = pre[p]) go[p][c] = nq;
        }
      }
      last = np;
    }
  }
  void watch() {
    for (int i = 1; i <= tot; i++) {
      printf("%2d :  pre=%2d  step=%2d ", i, pre[i], step[i]);
      for (int j = 0; j <= 25; j++)
        if (go[i][j]) printf(" ->%d(%c)", go[i][j], j + 'a');
      puts("");
    }
  }
  inline void bfs() {
    queue<int> q;
    for (int i = 1; i <= tot; i++) din[pre[i]]++;
    for (int i = tot; i >= 1; i--)
      if (!din[i]) q.push(i);
    while (int(q.size())) {
      int first = q.front();
      size[first] = same[first];
      for (int i = 0; i <= 25; i++) {
        int second = go[first][i];
        if (second) size[first] += size[second];
      }
      if (!--din[pre[first]]) q.push(pre[first]);
      same[pre[first]] += same[first];
      q.pop();
    }
  }
  inline void select(int first, long long k) {
    int c;
    while (k > 0) {
      for (int i = 0; i <= 25; i++) {
        int second = go[first][i];
        if (second) {
          if (k > size[second])
            k -= size[second];
          else {
            c = i;
            break;
          }
        }
      }
      putchar(c + 'a');
      first = go[first][c];
      k -= same[first];
    }
  }
} sam;
int main() {
  static char s[100010];
  scanf("%s", s);
  sam.build(s);
  sam.bfs();
  int k, n = strlen(s);
  scanf("%d", &k);
  if (k * 2ll > (n + 1ll) * n) return puts("No such line."), 0;
  sam.select(1, k);
  return 0;
}
