#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
char s[maxn];
int k;
struct node {
  string t;
  int pos;
  bool operator<(const node &a) const { return t > a.t; }
};
int main() {
  scanf("%s %d", s, &k);
  priority_queue<node> q;
  int len = strlen(s);
  node u, v;
  for (int i = 0; i < len; i++) {
    string now;
    now = now + s[i];
    u.t = now;
    u.pos = i;
    q.push(u);
  }
  int cnt = 0;
  while (!q.empty()) {
    u = q.top();
    q.pop();
    cnt++;
    if (cnt == k) {
      printf("%s\n", u.t.c_str());
      return 0;
    }
    if (u.pos == len - 1) continue;
    u.t += s[u.pos + 1];
    u.pos = u.pos + 1;
    q.push(u);
  }
  puts("No such line.");
  return 0;
}
