#include <bits/stdc++.h>
using namespace std;
struct node {
  int pos;
  string s;
};
bool operator<(node A, node B) { return A.s > B.s; }
int k, i, n;
node t;
string s, result;
priority_queue<node> P;
int main() {
  cin >> s >> k;
  n = s.size();
  for (i = 0; i < n; ++i) {
    t.s = s[i];
    t.pos = i;
    P.push(t);
  }
  while (k-- && !P.empty()) {
    t = P.top();
    P.pop();
    if (k == 0) result = t.s;
    if (t.pos + 1 < n) {
      t.s += s[++t.pos];
      P.push(t);
    }
  }
  if (k == -1)
    cout << result;
  else
    cout << "No such line.";
  return 0;
}
