#include <bits/stdc++.h>
using namespace std;
char s[100009];
struct Node {
  string s;
  int last;
  bool operator<(const Node &p) const { return s > p.s; }
};
priority_queue<Node> q;
int main() {
  gets(s);
  long long k;
  cin >> k;
  long long n = strlen(s);
  if (k > (1 + n) * n / 2) {
    printf("No such line.");
    return 0;
  }
  for (int i = 0; i < n; i++) {
    Node tmp;
    tmp.last = i;
    tmp.s = s[i];
    q.push(tmp);
  }
  while (1) {
    Node tmp = q.top();
    q.pop();
    k--;
    if (!k) {
      cout << tmp.s;
      return 0;
    }
    if (tmp.last < n - 1) {
      tmp.last++;
      tmp.s.push_back(s[tmp.last]);
      q.push(tmp);
    }
  }
}
