#include <bits/stdc++.h>
using namespace std;
const int INF = 2147483647;
const long long LLINF = 9223372036854775807LL;
const int maxn = 100010;
unsigned long long p[maxn] = {};
unsigned long long h[maxn] = {};
int n;
const unsigned long long base = 134543;
string s;
inline unsigned long long gethash(int i, int j) {
  return h[j] - (i ? h[i - 1] * p[j - i + 1] : 0);
}
int lcp(int i, int j) {
  int l = 0;
  int r = min(n - i, n - j) + 1;
  while (r - l > 1) {
    int m = (l + r) >> 1;
    if (gethash(i, i + m - 1) == gethash(j, j + m - 1))
      l = m;
    else
      r = m;
  }
  return l;
}
struct sub {
  int i, j;
  sub() {}
  sub(int i, int j) : i(i), j(j) {}
};
bool operator<(const sub &s2, const sub &s1) {
  int l1 = s1.j - s1.i + 1;
  int l2 = s2.j - s2.i + 1;
  int len = min(lcp(s1.i, s2.i), min(l1, l2));
  if (l2 == len) return false;
  if (l1 == len) return true;
  return s[s1.i + len] < s[s2.i + len];
}
int main() {
  cin >> s;
  n = s.length();
  int k;
  scanf("%d", &k);
  p[0] = 1;
  for (int i = 1; i < maxn; ++i) p[i] = p[i - 1] * base;
  for (int i = 0; i < (int)s.length(); ++i)
    h[i] = base * (i ? h[i - 1] : 0) + s[i] - 'a' + 1;
  priority_queue<sub> q;
  for (int i = 0; i < s.length(); ++i) q.push(sub(i, i));
  for (int i = 0; i < k; ++i) {
    if (q.empty()) printf("No such line."), exit(0);
    sub t = q.top();
    q.pop();
    if (i == k - 1) cout << s.substr(t.i, t.j - t.i + 1) << endl, exit(0);
    if (t.j + 1 < n) q.push(sub(t.i, t.j + 1));
  }
  return 0;
}
