#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
int day[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
template <typename T>
inline bool isLeap(T y) {
  return (y % 400 == 0) || (y % 100 ? y % 4 == 0 : false);
}
template <typename T>
inline T GCD(T a, T b) {
  a = abs(a);
  b = abs(b);
  if (a < b) swap(a, b);
  while (b) {
    a = a % b;
    swap(a, b);
  }
  return a;
}
template <typename T>
inline T EGCD(T a, T b, T &x, T &y) {
  if (a == 0) {
    x = 0;
    y = 1;
    return b;
  }
  T x1, y1;
  T d = EGCD(b % a, a, x1, y1);
  x = y1 - (b / a) * x1;
  y = x1;
  return d;
}
template <typename T>
inline T LCM(T x, T y) {
  T tp = GCD(x, y);
  if ((x / tp) * 1. * y > 9e18) return 9e18;
  return (x / tp) * y;
}
template <typename T>
inline T BigMod(T A, T B, T M = MOD) {
  T ret = 1;
  while (B) {
    if (B & 1) ret = (ret * A) % M;
    A = (A * A) % M;
    B = B >> 1;
  }
  return ret;
}
template <typename T>
inline T InvMod(T A, T M = MOD) {
  return BigMod(A, M - 2, M);
}
template <typename T>
void Compress(T *in, int n, int f = 0) {
  vector<T> vv;
  for (int i = f; i < n + f; i++) vv.push_back(in[i]);
  sort(vv.begin(), vv.end()), vv.erase(unique(vv.begin(), vv.end()), vv.end());
  for (int i = f; i < n + f; i++)
    in[i] = lower_bound(vv.begin(), vv.end(), in[i]) - vv.begin();
}
template <typename T>
T scani(T &n) {
  n = 0;
  bool negative = false;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') negative = true;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    n = n * 10 + c - 48;
    c = getchar();
  }
  if (negative) n = ~(n - 1);
  return n;
}
template <typename T>
void write(T n, int type = true) {
  if (n < 0) {
    putchar('-');
    n = -n;
  }
  if (!n) {
    putchar('0');
    if (type == 32)
      putchar(' ');
    else if (type)
      putchar('\n');
    return;
  }
  char buff[22];
  int len = 0;
  while (n) buff[len++] = n % 10 + 48, n /= 10;
  for (int i = len - 1; i >= 0; i--) putchar(buff[i]);
  if (type == 32)
    putchar(' ');
  else if (type)
    putchar('\n');
}
int scans(char *a) {
  int i = 0;
  char c = 0;
  while (c < 33) c = getchar();
  while (c > 33) {
    a[i++] = c;
    c = getchar();
  }
  a[i] = 0;
  return i;
}
const int pSz = 1000006;
bool np[pSz + 10];
vector<int> prime;
int prime_size;
void sieve() {
  np[0] = np[1] = 1;
  prime.push_back(2);
  for (long long i = 4; i <= pSz; i += 2) np[i] = 1;
  for (long long i = 3; i <= pSz; i += 2) {
    if (!np[i]) {
      prime.push_back(i);
      for (long long j = i * i; j <= pSz; j += (i << 1)) np[j] = 1;
    }
  }
  prime_size = prime.size();
}
template <typename T>
inline T SqrDis(T x1, T y1, T x2, T y2) {
  return ((x1 - x2) * (x1 - x2)) + ((y1 - y2) * (y1 - y2));
}
template <typename T>
inline T Area2(T Ax, T Ay, T Bx, T By, T Cx, T Cy) {
  T ret = Ax * (By - Cy) + Bx * (Cy - Ay) + Cx * (Ay - By);
  if (ret < 0) return ret = -ret;
  return ret;
}
const int N = 200005;
const int M = 200005;
const unsigned long long hs = 3797;
int n, stp, sfxMv, sfx[N], tmp[N];
int sfxSum[N], sfxCnt[N], Rank[22][N];
int lcp[N], rnk[N], Mc[N][22];
char in[N];
char a[N], b[N];
int na, nb;
inline bool equal(const int &u, const int &v) {
  if (!stp) return in[u] == in[v];
  if (Rank[stp - 1][u] != Rank[stp - 1][v]) return false;
  int a = u + sfxMv < n ? Rank[stp - 1][u + sfxMv] : -1;
  int b = v + sfxMv < n ? Rank[stp - 1][v + sfxMv] : -1;
  return a == b;
}
void update() {
  int i, rnk;
  for (i = 0; i < n; i++) sfxSum[i] = 0;
  for (i = rnk = 0; i < n; i++) {
    sfx[i] = tmp[i];
    if (i && !equal(sfx[i], sfx[i - 1])) {
      Rank[stp][sfx[i]] = ++rnk;
      sfxSum[rnk + 1] = sfxSum[rnk];
    } else
      Rank[stp][sfx[i]] = rnk;
    sfxSum[rnk + 1]++;
  }
}
void Sort() {
  int i;
  for (i = 0; i < n; i++) sfxCnt[i] = 0;
  memset(tmp, -1, sizeof tmp);
  for (i = 0; i < sfxMv; i++) {
    int idx = Rank[stp - 1][n - i - 1];
    int x = sfxSum[idx];
    tmp[x + sfxCnt[idx]] = n - i - 1;
    sfxCnt[idx]++;
  }
  for (i = 0; i < n; i++) {
    int idx = sfx[i] - sfxMv;
    if (idx < 0) continue;
    idx = Rank[stp - 1][idx];
    int x = sfxSum[idx];
    tmp[x + sfxCnt[idx]] = sfx[i] - sfxMv;
    sfxCnt[idx]++;
  }
  update();
  return;
}
inline bool cmp(const int &a, const int &b) {
  if (in[a] != in[b]) return in[a] < in[b];
  return false;
}
void print() {
  for (int i = (0); i < (n); ++i) {
    for (int j = (sfx[i]); j < (n); ++j) printf("%c", in[j]);
    putchar('\n');
  }
}
void suffixArray() {
  int i;
  for (i = 0; i < n; i++) tmp[i] = i;
  sort(tmp, tmp + n, cmp);
  stp = 0;
  update();
  ++stp;
  for (sfxMv = 1; sfxMv < n; sfxMv <<= 1) {
    Sort();
    stp++;
  }
  stp--;
  for (i = 0; i <= stp; i++) Rank[i][n] = -1;
}
void kasai() {
  for (int i = (0); i < (n); ++i) rnk[sfx[i]] = i;
  for (int i = 0, k = 0; i < n; i++, k ? k-- : 0) {
    if (rnk[i] == n - 1) {
      k = 0;
      continue;
    }
    int j = sfx[rnk[i] + 1];
    while (i + k < n && j + k < n && in[i + k] == in[j + k]) k++;
    lcp[rnk[i]] = k;
  }
}
void sparsTable() {
  for (int i = 0; i < n; i++) Mc[i][0] = lcp[i];
  for (int j = 1; (1 << j) <= n; j++)
    for (int i = 0; i + (1 << j) <= n; i++)
      Mc[i][j] = min(Mc[i][j - 1], Mc[i + (1 << (j - 1))][j - 1]);
}
int lcpMatch(int x, int y) {
  x = Rank[stp][x];
  y = Rank[stp][y];
  if (x == y) return n - sfx[x];
  if (x > y) swap(x, y);
  int k = log2(y - x);
  return min(Mc[x][k], Mc[y - (1 << k)][k]);
}
int lcpMatchSlow(int x, int y) {
  if (x == y) return n - x;
  int ret = 0;
  for (int i = stp; i >= 0 && x < n && y < n; i--) {
    if (Rank[i][x] == Rank[i][y]) {
      x += (1 << i);
      y += (1 << i);
      ret += (1 << i);
    }
  }
  return ret;
}
int done[N];
int main() {
  n = scans(in);
  suffixArray();
  kasai();
  int k;
  scani(k);
  for (int ix = (0); ix < (n); ++ix) {
    int low = done[ix] + 1, high = n - sfx[ix];
    for (int i = low; i <= high; i++) {
      int ic = ix;
      do {
        done[ic]++;
        k--;
        if (k == 0) {
          for (int j = (0); j < (i); ++j) {
            printf("%c", in[j + sfx[ix]]);
          }
          putchar('\n');
          return 0;
        }
      } while (lcp[ic++] >= i);
    }
  }
  puts("No such line.");
  return 0;
}
