#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e18;
const long long mod = 1e9 + 7;
const int inf = 0x3f3f3f3f;
const int N = 1e5 + 10;
template <typename T>
void chkmax(T &x, T y) {
  x = max(x, y);
}
template <typename T>
void chkmin(T &x, T y) {
  x = min(x, y);
}
long long qpow(long long x, long long y, long long MOD) {
  long long a = 1;
  while (y) {
    if (y & 1) a = a * x % MOD;
    x = x * x % MOD;
    y >>= 1;
  }
  return a;
}
int t1[N], t2[N], c[N], Log[30];
int sa[N], height[N], rk[N];
int s[N];
bool cmp(int *r, int a, int b, int l) {
  return r[a] == r[b] && r[a + l] == r[b + l];
}
void build_sa(int n, int m) {
  n++;
  int i, j, p, *x = t1, *y = t2;
  for (i = 0; i < m; i++) c[i] = 0;
  for (i = 0; i < n; i++) c[x[i] = s[i]]++;
  for (i = 1; i < m; i++) c[i] += c[i - 1];
  for (i = n - 1; i >= 0; i--) sa[--c[x[i]]] = i;
  for (j = 1; j <= n; j <<= 1) {
    p = 0;
    for (i = n - j; i < n; i++) y[p++] = i;
    for (i = 0; i < n; i++)
      if (sa[i] >= j) y[p++] = sa[i] - j;
    for (i = 0; i < m; i++) c[i] = 0;
    for (i = 0; i < n; i++) c[x[y[i]]]++;
    for (i = 1; i < m; i++) c[i] += c[i - 1];
    for (i = n - 1; i >= 0; i--) sa[--c[x[y[i]]]] = y[i];
    swap(x, y);
    p = 1;
    x[sa[0]] = 0;
    for (i = 1; i < n; i++)
      x[sa[i]] = cmp(y, sa[i - 1], sa[i], j) ? p - 1 : p++;
    if (p >= n) break;
    m = p;
  }
  int k = 0;
  n--;
  for (i = 0; i <= n; i++) rk[sa[i]] = i;
  for (i = 0; i < n; i++) {
    if (k) k--;
    int j = sa[rk[i] - 1];
    while (s[i + k] == s[j + k]) k++;
    height[rk[i]] = k;
  }
}
long long cal(int x, int n) {
  long long ans = 0;
  for (int i = int(1); i <= int(x); ++i) ans += n - sa[i];
  int cur = inf;
  for (int i = int(x + 1); i <= int(n); ++i) {
    chkmin(cur, height[i]);
    if (cur == 0) break;
    ans += cur;
  }
  return ans;
}
long long gao(int p, int x, int n) {
  long long ans = x - height[p];
  int cur = x;
  for (int i = int(p + 1); i <= int(n); ++i) {
    chkmin(cur, height[i]);
    if (cur <= height[p]) break;
    ans += cur - height[p];
  }
  return ans;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  string str;
  cin >> str;
  long long k;
  cin >> k;
  int n = str.size();
  for (int i = int(0); i <= int(n - 1); ++i) s[i] = str[i];
  s[n] = 0;
  build_sa(n, 128);
  int l = 1, r = n, res = -1;
  while (l <= r) {
    int mid = (l + r) >> 1;
    if (cal(mid, n) >= k)
      res = mid, r = mid - 1;
    else
      l = mid + 1;
  }
  if (res == -1) {
    cout << "No such line.";
    return 0;
  }
  k -= cal(res - 1, n);
  l = height[res] + 1, r = n - sa[res];
  int anslen = 0;
  while (l <= r) {
    int mid = (l + r) >> 1;
    if (gao(res, mid, n) >= k)
      anslen = mid, r = mid - 1;
    else
      l = mid + 1;
  }
  string ans = str.substr(sa[res], anslen);
  cout << ans << endl;
  return 0;
}
