#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
long long powmod(long long a, long long b) {
  long long res = 1;
  a %= mod;
  for (; b; b >>= 1) {
    if (b & 1) res = res * a % mod;
    a = a * a % mod;
  }
  return res;
}
long long gcd(long long a, long long b) {
  while (b != 0) {
    long long t = b;
    b = a % b;
    a = t;
  }
  return a;
}
void debug(long long* a, long long n) {
  for (long long i = 0; i < n; i++) cout << a[i] << " ";
  cout << '\n';
}
void debug(vector<long long> b, long long n) {
  for (long long i = 0; i < n; i++) cout << b[i] << " ";
  cout << '\n';
}
long long len = 20, step, n;
long long power[25];
long long p[25][100005];
struct node {
  long long one;
  long long two;
  long long index;
};
void fun() {
  long long i;
  power[0] = 1;
  for (i = 1; i < 25; i++) {
    power[i] = power[i - 1] * 2;
  }
}
bool compare(node a, node b) {
  if (a.one < b.one || (a.one == b.one && a.two < b.two)) {
    return 1;
  }
  return 0;
}
long long findme(long long n1, long long n2) {
  long long i, ans = 0;
  for (i = step; i >= 0; i--) {
    if (n1 + power[i] > n + 1 || n2 + power[i] > n + 1) continue;
    if (p[i][n1] == p[i][n2]) {
      ans += power[i];
      n1 += power[i];
      n2 += power[i];
    }
  }
  return ans;
}
long long aavi_gayeli[200005];
int32_t main() {
  fun();
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long i, j;
  string s;
  cin >> s;
  s = '-' + s;
  n = s.length() - 1;
  long long sa[n + 3];
  if (n == 1) {
    long long m;
    cin >> m;
    if (m == 1)
      cout << s[1] << '\n';
    else
      cout << "No such line." << '\n';
    return 0;
  }
  node suff[n + 3];
  for (i = 1; i <= n; i++) {
    p[0][i] = s[i] - 'a';
  }
  suff[0].one = suff[0].two = suff[0].index = 0;
  step = 0;
  for (i = 1; power[i - 1] < n; i++, step++) {
    for (j = 1; j <= n; j++) {
      suff[j].index = j;
      suff[j].one = p[i - 1][j];
      suff[j].two = (j + power[i - 1] <= n ? p[i - 1][j + power[i - 1]] : -1);
    }
    sort(suff + 1, suff + n + 1, compare);
    for (j = 1; j <= n; j++) {
      p[i][suff[j].index] = (j > 1 && suff[j].one == suff[j - 1].one &&
                                     suff[j].two == suff[j - 1].two
                                 ? p[i][suff[j - 1].index]
                                 : j);
    }
  }
  for (i = 1; i <= n; i++) {
    sa[p[step][i]] = i;
  }
  long long lcp[n + 3];
  long long m;
  cin >> m;
  long long maxi = (n * (n + 1)) / 2;
  if (m > maxi) {
    cout << "No such line." << '\n';
    return 0;
  }
  long long st, en;
  long long flag = 0;
  for (i = 1; i <= n; i++) {
    if (flag) break;
    for (long long j = aavi_gayeli[i] + 1; j <= n; j++) {
      if (flag) break;
      for (long long k = i; k <= n; k++) {
        long long x = findme(sa[i], sa[k]);
        if (x >= j) {
          aavi_gayeli[k] = j;
          m--;
        } else
          break;
        if (m == 0) {
          st = sa[i];
          en = sa[i] + aavi_gayeli[k];
          flag = 1;
          break;
        }
      }
    }
  }
  for (long long i = st; i < en; i++) cout << s[i];
  cout << '\n';
  return 0;
}
