#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5, mod = 1e9 + 7, inf = 0x3f3f3f3f;
template <class T>
T QuickMod(T a, T b, T c) {
  T ans = 1;
  while (b) {
    if (b & 1) ans = ans * a % c;
    b >>= 1;
    a = (a * a) % c;
  }
  return ans;
}
template <class T>
T Gcd(T a, T b) {
  return b != 0 ? Gcd(b, a % b) : a;
}
template <class T>
T Lcm(T a, T b) {
  return a / Gcd(a, b) * b;
}
template <class T>
void outln(T x) {
  cout << x << endl;
}
struct substring {
  string str;
  int pos;
  bool operator<(const substring &t) const { return str > t.str; }
};
priority_queue<substring> q;
char s[maxn];
int k, n;
int main() {
  gets(s);
  cin >> k;
  for (n = 0; s[n]; n++) q.push((substring){string(1, s[n]), n});
  if (k > 1ll * n * (n + 1) / 2)
    puts("No such line.");
  else {
    int cnt = 0;
    while (!q.empty()) {
      substring t = q.top();
      q.pop();
      if (++cnt == k) {
        cout << t.str << endl;
        return 0;
      }
      if (t.pos != n - 1) {
        t.str += s[++t.pos];
        q.push(t);
      }
    }
  }
  return 0;
}
