#include <bits/stdc++.h>
using namespace std;
template <typename T>
T inline SQR(const T &a) {
  return a * a;
}
long long MOD = 1000000007LL;
long long mypow(long long a, long long p) {
  if (p == 0) return 1LL;
  long long ans = mypow(a, p / 2);
  ans *= ans;
  ans %= MOD;
  if (p & 1) return (a * ans) % MOD;
  return ans;
}
struct sub {
  string s;
  int ind;
  bool operator<(const sub &a) const { return s > a.s; }
};
int main() {
  ios::sync_with_stdio(false);
  string s;
  int k, sz;
  cin >> s >> k;
  sz = (int)s.size();
  priority_queue<sub> q;
  sub aux;
  for (int i = 0; i < sz; ++i) {
    aux.s = s[i];
    aux.ind = i;
    q.push(aux);
  }
  int num;
  for (num = 1; num <= k && !q.empty(); num++) {
    aux = q.top();
    q.pop();
    if (num == k) break;
    if (aux.ind + 1 < sz) {
      aux.s += s[aux.ind + 1];
      aux.ind++;
      q.push(aux);
    }
  }
  if (num == k)
    cout << aux.s << endl;
  else
    cout << "No such line." << endl;
  return 0;
}
