#include <bits/stdc++.h>
using namespace std;
int k;
string s;
struct to {
  int p;
  string s;
};
bool operator<(const to &a, const to &b) { return a.s > b.s; }
priority_queue<to> Q;
int main() {
  cin >> s >> k;
  if ((long long int)s.size() * (s.size() + 1) / 2 < (long long int)k) {
    cout << "No such line.\n";
    return 0;
  }
  for (int i = (0); i < (s.size()); i++) {
    to tmp;
    tmp.p = i;
    tmp.s = s[i];
    Q.push(tmp);
  }
  while (k) {
    to tmp = Q.top();
    Q.pop();
    if (k == 1) cout << tmp.s << "\n";
    if (tmp.p < s.size() - 1) {
      tmp.p++;
      tmp.s += s[tmp.p];
      Q.push(tmp);
    }
    k--;
  }
  return 0;
}
