#include <bits/stdc++.h>
long long int mod = 1000000000 + 7;
long long int inf = (long long int)(5e18);
using namespace std;
mt19937 unlucko(chrono::steady_clock::now().time_since_epoch().count());
int main() {
  iostream::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  string s;
  cin >> s;
  int k;
  cin >> k;
  int n = s.length();
  if ((long long int)k > n * (n + 1LL) / 2LL) {
    cout << "No such line.";
    return 0;
  }
  vector<int> a[26];
  for (int i = 0; i < n; i++) {
    a[s[i] - 'a'].push_back(i);
  }
  long long int curr = 0;
  string ans = "";
  while (curr < k) {
    for (int i = 0; i < 26; i++) {
      long long int temp = 0;
      for (auto it : a[i]) {
        temp += n - it;
      }
      if (curr + temp >= k) {
        ans += i + 'a';
        curr += a[i].size();
        break;
      }
      curr += temp;
    }
    vector<int> b[26];
    for (auto it : a[ans.back() - 'a']) {
      if (it != n - 1) b[s[it + 1] - 'a'].push_back(it + 1);
    }
    for (int i = 0; i < 26; i++) {
      a[i].clear();
      a[i] = b[i];
    }
  }
  cout << ans;
}
