#include <bits/stdc++.h>
using namespace std;
const int INF = 1000000000;
const double EPS = 1e-9;
typedef struct {
  string first;
  int second;
} lho;
lho loh;
bool operator<(const lho &a, const lho &b) { return a.first > b.first; }
priority_queue<lho> pq;
char tmp[100005];
int main() {
  scanf("%s", tmp);
  string s = tmp;
  int k;
  scanf("%d", &k);
  int n = s.size();
  if ((long long)n * (long long)(n + 1) / 2LL < (long long)k) {
    printf("No such line.\n");
    return 0;
  }
  for (int i = 0; i < n; i++) {
    loh.first = s[i];
    loh.second = i;
    pq.push(loh);
  }
  lho cur;
  while (k--) {
    cur = pq.top();
    pq.pop();
    if (cur.second + 1 < n) {
      loh.first = cur.first + s[cur.second + 1];
      loh.second = cur.second + 1;
      pq.push(loh);
    }
  }
  printf("%s\n", cur.first.c_str());
  return 0;
}
