#include <bits/stdc++.h>
using namespace std;
const long long N = 100005;
const long long MAX = 100010;
char txt[MAX];
long long iSA[MAX], SA[MAX];
long long cnt[MAX], nxt[MAX];
long long sum[MAX];
bool bh[MAX], b2h[MAX];
bool smaller_first_char(long long a, long long b) { return txt[a] < txt[b]; }
void suffixSort(long long n) {
  for (long long i = 0; i < n; ++i) {
    SA[i] = i;
  }
  sort(SA, SA + n, smaller_first_char);
  for (long long i = 0; i < n; ++i) {
    bh[i] = i == 0 || txt[SA[i]] != txt[SA[i - 1]];
    b2h[i] = false;
  }
  for (long long h = 1; h < n; h <<= 1) {
    long long buckets = 0;
    for (long long i = 0, j; i < n; i = j) {
      j = i + 1;
      while (j < n && !bh[j]) j++;
      nxt[i] = j;
      buckets++;
    }
    if (buckets == n) break;
    for (long long i = 0; i < n; i = nxt[i]) {
      cnt[i] = 0;
      for (long long j = i; j < nxt[i]; ++j) {
        iSA[SA[j]] = i;
      }
    }
    cnt[iSA[n - h]]++;
    b2h[iSA[n - h]] = true;
    for (long long i = 0; i < n; i = nxt[i]) {
      for (long long j = i; j < nxt[i]; ++j) {
        long long s = SA[j] - h;
        if (s >= 0) {
          long long head = iSA[s];
          iSA[s] = head + cnt[head]++;
          b2h[iSA[s]] = true;
        }
      }
      for (long long j = i; j < nxt[i]; ++j) {
        long long s = SA[j] - h;
        if (s >= 0 && b2h[iSA[s]]) {
          for (long long k = iSA[s] + 1; !bh[k] && b2h[k]; k++) b2h[k] = false;
        }
      }
    }
    for (long long i = 0; i < n; ++i) {
      SA[iSA[i]] = i;
      bh[i] |= b2h[i];
    }
  }
  for (long long i = 0; i < n; ++i) {
    iSA[SA[i]] = i;
  }
}
long long getnxt(long long l, long long r, long long j) {
  char val = txt[SA[l] + j];
  long long low = l;
  long long high = r;
  long long ans = l;
  while (high - low >= 0) {
    long long mid = (low + high) / 2;
    if (txt[SA[mid] + j] == val) {
      ans = mid;
      low = mid + 1;
    } else
      high = mid - 1;
  }
  return ans;
}
long long getSum(long long l, long long r) {
  if (l == 0)
    return sum[r];
  else
    return sum[r] - sum[l - 1];
}
void solve() {
  long long n, k;
  scanf("%s", txt);
  scanf("%lld", &k);
  n = strlen(txt);
  long long total = (n * (n + 1)) / 2;
  if (k > total) {
    printf("No such line.\n");
    return;
  }
  suffixSort(n);
  for (long long i = 0; i < n; i++) {
    sum[i] = n - SA[i];
    if (i != 0) sum[i] += sum[i - 1];
  }
  long long l = 0;
  long long r = n - 1;
  long long v;
  long long j = 0;
  string ans;
  while (1) {
    if (N - SA[l] == j) l++;
    ans += 'a';
    while (1) {
      ans[j] = txt[SA[l] + j];
      long long v = getnxt(l, r, j);
      long long cnt = getSum(l, v) - j * (v - l + 1);
      if (cnt < k) {
        k -= cnt;
        l = v + 1;
      } else {
        k -= (v - l + 1);
        if (k <= 0) {
          cout << ans << '\n';
          return;
        }
        r = v;
        break;
      }
    }
    j++;
  }
}
signed main() {
  long long t;
  ios_base::sync_with_stdio(false);
  t = 1;
  while (t--) solve();
  return 0;
}
