#include <bits/stdc++.h>
using namespace std;
const int N = 100003;
char s[N];
int t[N];
vector<char> res;
int n, k;
inline bool cmp(int i, int j) { return s[i] < s[j]; }
bool calc(int* b, int* e) {
  k -= e - b;
  if (k <= 0) return true;
  for (int* p = b; p != e; ++p) ++*p;
  sort(b, e, cmp);
  if (*b == n) ++b;
  for (int* p = b; p != e;) {
    int* q = p;
    while (q != e && s[*p] == s[*q]) ++q;
    char c = s[*p];
    if (calc(p, q)) {
      res.push_back(c);
      return true;
    }
    p = q;
  }
  return false;
}
int main() {
  scanf("%s%d", s, &k);
  n = strlen(s);
  k += n;
  for (int i = 0; i < n; ++i) t[i] = i - 1;
  if (calc(t, t + n)) {
    while (!res.empty()) {
      printf("%c", res.back());
      res.pop_back();
    }
    printf("\n");
  } else
    puts("No such line.");
  return 0;
}
