#include <bits/stdc++.h>
using namespace std;
const int INF = (int)1E9 + 5;
const long long LINF = (long long)4E18 + 5;
const long double PI = acos(-1.0);
const long double E = 2.718281828459045L;
template <typename T>
T gcd(T a, T b) {
  return (b == 0) ? abs(a) : gcd(b, a % b);
}
template <typename T>
inline T lcm(T a, T b) {
  return a / gcd(a, b) * b;
}
template <typename T>
inline T mod(T a, T b) {
  return (a % b + b) % b;
}
template <typename T>
inline T sqr(T x) {
  return x * x;
}
template <typename T>
inline string toString(const T& x) {
  ostringstream os;
  os << x;
  return os.str();
}
inline long long toInt(const string& s) {
  istringstream is(s);
  long long x;
  is >> x;
  return x;
}
inline long double toDouble(const string& s) {
  istringstream is(s);
  long double x;
  is >> x;
  return x;
}
inline string toLower(string s) {
  for (typeof((s).begin()) it = (s).begin(); it != (s).end(); ++it)
    *it = tolower(*it);
  return s;
}
inline string toUpper(string s) {
  for (typeof((s).begin()) it = (s).begin(); it != (s).end(); ++it)
    *it = toupper(*it);
  return s;
}
using namespace std;
struct node {
  string s;
  int k;
};
bool operator<(node a, node b) { return a.s > b.s; }
int main() {
  string s, answer;
  int k, n;
  priority_queue<node> pq;
  node tmp;
  cin >> s >> k;
  n = ((int)(s).size());
  if (2 * k > (long long)n * (n + 1)) {
    cout << "No such line.";
    return 0;
  }
  for (int i = 0; i < (((int)(s).size())); i++) {
    tmp.k = i;
    tmp.s += s[i];
    pq.push(tmp);
    tmp.s.clear();
  }
  while (k--) {
    tmp = pq.top();
    pq.pop();
    if (!k) {
      answer = tmp.s;
    }
    if (tmp.k + 1 < ((int)(s).size())) {
      tmp.k++;
      tmp.s += s[tmp.k];
      pq.push(tmp);
    }
  }
  cout << answer;
  return 0;
}
