#include <bits/stdc++.h>
using namespace std;
struct node {
  string first;
  int second;
  bool operator>(const node &o) const {
    int cmp = first.compare(o.first);
    if (cmp != 0) return cmp > 0;
    return second > o.second;
  }
};
string kthSubstring(string &s, int k) {
  priority_queue<node, vector<node>, greater<node>> pq;
  int len = s.length();
  for (int i = 0; i < len; i++) {
    pq.push({string(1, s[i]), i});
  }
  string a;
  while (!pq.empty()) {
    if (--k == 0) {
      return pq.top().first;
    }
    node curr = pq.top();
    pq.pop();
    if (curr.second < len - 1) {
      a = curr.first;
      a += s[curr.second + 1];
      curr.second++;
      pq.push({a, curr.second});
    }
  }
  return "";
}
int main() {
  string s;
  int k;
  cin >> s >> k;
  int len = s.length();
  long long possible = ((long long)len * (len + 1)) / 2;
  if (k > possible)
    cout << "No such line." << '\n';
  else
    cout << kthSubstring(s, k) << '\n';
  return 0;
}
