#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const int N = 5e5 + 10;
string s;
bool cmp(const int &a, const int &b) { return s[a] < s[b]; }
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int k;
  cin >> s >> k;
  int len = (int)s.size();
  vector<int> v;
  long long jk = 0ll;
  for (int i = 0; i < len; i++) {
    v.push_back(i);
    jk += len - i;
  }
  if (jk < k) {
    puts("No such line.");
    return 0;
  }
  string ans;
  while (k > 0) {
    sort(v.begin(), v.end(), cmp);
    for (int i = 0; i < (int)v.size() && k > 0; i++) {
      int indx = i;
      long long pp = len - v[i];
      while (i + 1 < (int)v.size() && s[v[i]] == s[v[i + 1]])
        pp += (long long)(len - v[++i]);
      if (pp < k)
        k -= pp;
      else {
        k -= (i - indx + 1);
        ans += s[v[indx]];
        vector<int> tmp;
        for (int j = indx; j <= i; j++) {
          if (v[j] + 1 < len) tmp.push_back(v[j] + 1);
        }
        v = tmp;
        break;
      }
    }
  }
  cout << ans << '\n';
  return 0;
}
