#include <bits/stdc++.h>
using namespace std;
int n, nn, o;
char s[100005];
char ans[100005];
long long sum;
long long a[26];
vector<int> pos[26];
vector<int> temp;
int main() {
  cin >> s >> o;
  n = strlen(s);
  for (int i(0); i < n; i++) {
    pos[s[i] - 'a'].push_back(i);
    a[s[i] - 'a'] += n - i;
    sum += n - i;
  }
  if (o > sum) {
    cout << "No such line." << endl;
    return 0;
  }
  for (;;) {
    int k = 0;
    for (; k < 26 and o > a[k]; k++) o -= a[k];
    ans[nn++] = k + 'a';
    if (o <= pos[k].size()) {
      for (int i(0); i < nn; i++) cout << ans[i];
      return 0;
    }
    o -= pos[k].size();
    temp = pos[k];
    for (int i(0); i < 26; i++) {
      pos[i].clear();
      a[i] = 0;
    }
    for (int ii(0); ii < temp.size(); ii++) {
      int i = temp[ii] + 1;
      if (i >= n) break;
      pos[s[i] - 'a'].push_back(i);
      a[s[i] - 'a'] += n - i;
    }
  }
}
