#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e5 + 5;
char str[MAX];
struct substring {
  char *l, *r;
  substring() {}
  substring(char *_l, char *_r) : l(_l), r(_r) {}
  bool operator<(const substring &other) const {
    return !lexicographical_compare(l, r, other.l, other.r);
  }
};
int main() {
  scanf("%s", str);
  int n = strlen(str);
  int k;
  scanf("%d", &k);
  if ((1LL * n * (n + 1)) / 2 < k) {
    puts("No such line.");
    return 0;
  }
  priority_queue<substring> pq;
  for (int i = int(0); i < int(n); i++) {
    pq.emplace(str + i, str + i + 1);
  }
  for (int i = int(0); i < int(k - 1); i++) {
    substring cur = pq.top();
    pq.pop();
    if (cur.r != str + n) {
      pq.emplace(cur.l, cur.r + 1);
    }
  }
  substring ans = pq.top();
  for (char *p = ans.l; p != ans.r; p++) {
    printf("%c", *p);
  }
  puts("");
  return 0;
}
