#include <bits/stdc++.h>
using namespace std;
vector<vector<int> > GG;
int main() {
  ios::sync_with_stdio(false);
  string s;
  int k;
  cin >> s >> k;
  string ans;
  if ((long long)s.length() * (s.length() + 1) / 2 < k) {
    cout << "No such line.";
    return 0;
  }
  GG.resize(26, vector<int>());
  long long a[27], b[27], temp = 0;
  bool ok = true;
  int iteration = 0;
  a[0] = b[0] = 0;
  int last = -1;
  while (ok) {
    vector<vector<int> > tempp(26, vector<int>());
    for (int i = 1; i <= 26; ++i) {
      tempp[i - 1].clear();
      b[i] = a[i] = 0;
    }
    if (iteration == 0) {
      for (int i = 0; i < s.length(); ++i) {
        a[s[i] - 'a' + 1] += s.length() - i;
        ++b[s[i] - 'a' + 1];
        if (i + 1 < s.length()) tempp[s[i] - 'a'].push_back(i + 1);
      }
      ++iteration;
    } else {
      for (int i = 0; i < GG[last].size(); ++i) {
        a[s[GG[last][i]] - 'a' + 1] += s.length() - GG[last][i];
        ++b[s[GG[last][i]] - 'a' + 1];
        if (GG[last][i] + 1 < s.length())
          tempp[s[GG[last][i]] - 'a'].push_back(GG[last][i] + 1);
      }
    }
    for (int i = 0; i <= 26; ++i) {
      if (temp + a[i] >= k) {
        if (i == 0) {
          ok = false;
        } else {
          ans += (char)(i - 1 + 'a');
          a[0] = b[i];
          last = i - 1;
        }
        break;
      }
      temp += a[i];
    }
    GG = tempp;
  }
  cout << ans;
  return 0;
}
