#include <bits/stdc++.h>
using namespace std;
struct node {
  string s;
  int nxt;
  bool operator<(const node& cmp) const { return s > cmp.s; }
};
int n, k;
priority_queue<node> Q;
char str[100010];
string solve() {
  if ((long long)n * (n + 1) / 2 < k) {
    return "No such line.";
  }
  string ret = "";
  while (!Q.empty()) {
    node fr = Q.top();
    Q.pop();
    k--;
    if (k == 0) {
      ret = fr.s;
      return ret;
    }
    if (fr.nxt < n) {
      fr.s += str[fr.nxt++];
      Q.push(fr);
    }
  }
  return ret;
}
int main() {
  scanf("%s%d", str, &k);
  node tmp;
  for (int i = 0; str[i]; i++) {
    tmp.s = "";
    tmp.s += str[i];
    tmp.nxt = i + 1;
    Q.push(tmp);
    n = i + 1;
  }
  cout << solve() << endl;
  return 0;
}
