#include <bits/stdc++.h>
using namespace std;
long long num[26];
vector<int> pos[26];
vector<int> temp;
char str[100010];
char ans[100000];
long long cnt;
long long k;
int main() {
  cin >> str >> k;
  long long len = strlen(str);
  for (int i = 0; i < len; ++i) {
    int p = str[i] - 'a';
    num[p] += len - i;
    ;
    pos[p].push_back(i);
  }
  if (k > (len + 1) * len / 2) {
    cout << "No such line." << endl;
    return 0;
  }
  int p;
  for (p = 0; p < 27; ++p) {
    if (k > num[p])
      k -= num[p];
    else
      break;
  }
  while (k > 0) {
    if (p == 27) p--;
    ans[cnt++] = p + 'a';
    cout << (char)(p + 'a');
    memset(num, 0, sizeof(num));
    temp.clear();
    int size = pos[p].size();
    k -= size;
    if (k <= 0)
      break;
    else {
      for (int i = 0; i < size; ++i) temp.push_back(pos[p][i]);
      for (int i = 0; i < 26; ++i) pos[i].clear();
      for (int i = 0; i < size; ++i) {
        int t = temp[i] + 1;
        if (t >= len) continue;
        int ind = str[t] - 'a';
        num[ind] += len - t;
        pos[ind].push_back(t);
      }
      for (p = 0; p < 27; ++p) {
        if (k > num[p])
          k -= num[p];
        else
          break;
      }
    }
  }
  ans[cnt] = '\0';
  cout << endl;
  return 0;
}
