#include <bits/stdc++.h>
using namespace std;
long long i, j, k, n;
multiset<pair<string, long long> > q;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  string s;
  cin >> s >> k;
  n = s.size();
  if (k > (n * (n + 1)) / 2) {
    cout << "No such line.";
    return 0;
  }
  for (i = 0; i < s.size(); i++) {
    string ss = "";
    ss += s[i];
    q.insert({ss, i});
  }
  for (i = 1; i <= k; i++) {
    pair<string, long long> cur = *q.begin();
    q.erase(q.begin());
    if (i == k) {
      cout << cur.first;
      return 0;
    }
    if (cur.second + cur.first.size() < n) {
      string ss = cur.first + s[cur.second + cur.first.size()];
      q.insert({ss, cur.second});
    }
  }
  return 0;
}
