#include <bits/stdc++.h>
using namespace std;
struct ele {
  string s;
  int p;
  bool operator<(const ele& e) const { return s > e.s; }
};
int main() {
  std::ios::sync_with_stdio(0);
  std::cin.tie(0);
  int k;
  string s;
  cin >> s >> k;
  int n = s.size();
  if (k > 1LL * n * (n + 1) / 2) {
    cout << "No such line.";
    return 0;
  }
  priority_queue<ele> q;
  for (int i = 0; i < n; ++i) {
    ele tmp;
    tmp.s += s[i];
    tmp.p = i;
    q.push(tmp);
  }
  while (k > 0) {
    --k;
    if (k == 0) {
      cout << q.top().s;
      break;
    }
    ele e = q.top();
    q.pop();
    if (e.p < n - 1) {
      e.s += s[++e.p];
      q.push(e);
    }
  }
}
