#include <bits/stdc++.h>
using namespace std;
string s;
int main() {
  int k;
  while (cin >> s >> k) {
    int n = s.size();
    if (k > (long long)n * (n + 1) / 2) {
      cout << "No such line." << endl;
    } else {
      vector<int> candidate(s.size());
      for (int i = 0; i < s.size(); i++) {
        candidate[i] = i;
      }
      string ans;
      int offset = 0;
      while (true) {
        vector<long long> stat(26), num(26);
        for (size_t i = 0; i < candidate.size(); i++) {
          stat[s[candidate[i] + offset] - 'a']++;
          num[s[candidate[i] + offset] - 'a'] +=
              s.size() - candidate[i] - offset;
        }
        for (int i = 0; i < 26; i++) {
          if (k <= num[i]) {
            ans += 'a' + i;
            if (k <= stat[i]) {
              cout << ans << endl;
              goto next;
            }
            k -= stat[i];
            vector<int> nextCandidate;
            for (size_t j = 0; j < candidate.size(); j++) {
              if (s[candidate[j] + offset] == i + 'a' &&
                  candidate[j] + offset + 1 < s.size()) {
                nextCandidate.push_back(candidate[j]);
              }
            }
            swap(nextCandidate, candidate);
            offset++;
            break;
          } else {
            k -= num[i];
          }
        }
      }
    }
  next:;
  }
  return 0;
}
