#include <bits/stdc++.h>
using namespace std;
const int N = 100002;
int k, len;
char a[N], ans[N];
set<int> matches;
pair<long long, long long> solve(int j, int i) {
  pair<long long, long long> ret = make_pair(0, 0);
  for (int x : matches)
    if (a[x + j] - 'a' == i) {
      ++ret.second;
      ret.first += len - (x + j);
    }
  return ret;
}
void eliminate(int j) {
  vector<int> del;
  for (int i : matches)
    if (a[i + j] != ans[j]) del.push_back(i);
  for (int i : del) matches.erase(i);
}
int main() {
  scanf("%s", a);
  scanf("%d", &k);
  len = strlen(a);
  if (k > 1ll * len * (len + 1) / 2) cout << "No such line.", exit(0);
  for (int i = (0); i <= (int)(len - 1); ++i) matches.insert(i);
  int j = 0;
  long long cur = 0;
  while (true) {
    pair<long long, long long> add;
    for (int i = (0); i <= (int)(25); ++i) {
      ans[j] = i + 'a';
      add = solve(j, i);
      if (cur + add.first >= k) break;
      cur += add.first;
    }
    cur += add.second;
    if (cur >= k) break;
    eliminate(j);
    ++j;
  }
  ans[++j] = '\0';
  printf("%s", ans);
}
