#include <bits/stdc++.h>
using namespace std;
void printV(vector<int> V) {
  cout << "[";
  for (int x : V) cout << x << ", ";
  cout << "]\n";
}
int getV(tuple<int, int, int> t, int i) {
  if (i == 0) return get<0>(t);
  if (i == 1) return get<1>(t);
  if (i == 2) return get<2>(t);
  return -1;
}
pair<vector<int>, int> radixSort(vector<tuple<int, int, int>> V, int n) {
  n++;
  vector<vector<int>> B(n, vector<int>());
  vector<int> Order;
  for (int i = 0; i < (int)V.size(); ++i) Order.push_back(i);
  for (int j = 2; j >= 0; --j) {
    for (int ii = 0; ii < (int)V.size(); ++ii) {
      int i = Order[ii];
      B[getV(V[i], j) + 1].push_back(i);
    }
    Order.clear();
    for (int b = 0; b < n; ++b) {
      for (int x : B[b]) {
        Order.push_back(x);
      }
      B[b].clear();
    }
  }
  vector<int> rank((int)V.size(), 0);
  int r = 0;
  for (int i = 0; i < (int)V.size(); ++i) {
    if (i > 0 && V[Order[i]] != V[Order[i - 1]]) r++;
    rank[Order[i]] = r;
  }
  return {rank, r + 1};
}
vector<int> orderToRank(vector<int> order) {
  vector<int> rank((int)order.size(), 0);
  for (int i = 0; i < (int)order.size(); ++i) {
    rank[order[i]] = i;
  }
  return rank;
}
vector<int> rankToOrder(vector<int> rank) { return orderToRank(rank); }
vector<int> sortSuffixes(vector<int> V) {
  int n = (int)V.size();
  V.push_back(-1);
  V.push_back(-1);
  V.push_back(-1);
  vector<vector<tuple<int, int, int>>> T(3, vector<tuple<int, int, int>>());
  for (int i = 0; i <= n; ++i) {
    T[i % 3].emplace_back(V[i], V[i + 1], V[i + 2]);
  }
  int T1size = (int)T[1].size();
  int T2size = (int)T[2].size();
  vector<tuple<int, int, int>> T12(T[1]);
  T12.insert(T12.end(), T[2].begin(), T[2].end());
  vector<int> T12_rank;
  int rankCount;
  vector<int> SA_12, suffix12_rank;
  tie(T12_rank, rankCount) = radixSort(T12, n);
  if (rankCount == (int)T12.size()) {
    suffix12_rank = T12_rank;
    SA_12 = rankToOrder(T12_rank);
  } else {
    SA_12 = sortSuffixes(T12_rank);
    suffix12_rank = orderToRank(SA_12);
  }
  vector<tuple<int, int, int>> T0_m(T[0]);
  for (int i = 0; i < (int)T0_m.size(); ++i) {
    get<1>(T0_m[i]) = i < T1size ? suffix12_rank[i] : -1;
  }
  vector<int> T0_rank = radixSort(T0_m, 2 * n).first;
  vector<int> T0_order = rankToOrder(T0_rank);
  vector<int> SA;
  int i12 = 0, i0 = 0;
  int max12 = (int)SA_12.size(), max0 = (int)T0_order.size();
  while (i12 < max12 || i0 < max0) {
    if (i12 == max12)
      SA.push_back(T0_order[i0++] * 3);
    else if (i0 == max0) {
      int s12 = SA_12[i12++];
      SA.push_back(s12 < T1size ? s12 * 3 + 1 : (s12 - T1size) * 3 + 2);
    } else {
      bool i0Smaller;
      int s0 = T0_order[i0], s12 = SA_12[i12];
      bool isT1 = s12 < T1size;
      if (isT1) {
        pair<int, int> p0, p12;
        p0 = {V[3 * s0], s0 < T1size ? suffix12_rank[s0] : -1};
        p12 = {V[3 * s12 + 1], s12 < T2size ? suffix12_rank[T1size + s12] : -1};
        i0Smaller = p0 < p12;
      } else {
        tuple<int, int, int> t0, t12;
        t0 = {V[3 * s0], V[3 * s0 + 1],
              (s0 < T2size ? suffix12_rank[T1size + s0] : -1)};
        int s = s12 - T1size;
        t12 = {V[3 * s + 2], V[3 * s + 3],
               (s + 1 < T1size ? suffix12_rank[s + 1] : -1)};
        i0Smaller = t0 < t12;
      }
      if (i0Smaller)
        SA.push_back(s0 * 3), i0++;
      else
        SA.push_back(s12 < T1size ? s12 * 3 + 1 : (s12 - T1size) * 3 + 2),
            i12++;
    }
  }
  SA.erase(SA.begin());
  return SA;
}
vector<int> genLCP(string s, vector<int> SA) {
  int n = (int)SA.size(), k = 0;
  vector<int> rank(n, 0), lcp(n, 0);
  for (int i = 0; i < n; ++i) rank[SA[i]] = i;
  for (int i = 0; i < n; ++i, k ? k-- : 0) {
    if (rank[i] == n - 1) {
      k = 0;
      continue;
    }
    int j = SA[rank[i] + 1];
    while (i + k < n && j + k < n && s[i + k] == s[j + k]) k++;
    lcp[rank[i]] = k;
  }
  return lcp;
}
vector<int> genSA(string s) {
  set<char> alphabet;
  map<char, int> M;
  for (char c : s) alphabet.insert(c);
  int x = 0;
  for (char c : alphabet) M[c] = x++;
  vector<int> V;
  for (char c : s) V.push_back(M[c]);
  return sortSuffixes(V);
}
int main() {
  string s;
  int K, n;
  cin >> s >> K;
  n = (int)s.size();
  vector<int> v = genSA(s);
  vector<int> lcp = genLCP(s, v);
  vector<int> d(n + 1, 0);
  for (int i = 0; i < n; ++i) {
    for (int j = d[i]; j < n - v[i]; ++j) {
      int k = i;
      do {
        d[k] = j + 1;
        K--;
        if (K == 0) {
          int l = j + 1;
          cout << s.substr(v[i], l) << endl;
          return 0;
        }
        k++;
      } while (lcp[k - 1] > j);
    }
  }
  cout << "No such line.\n";
}
