#include <bits/stdc++.h>
using namespace std;
struct node {
  string str;
  int ind;
  node() {}
  node(string a, int b) {
    str = a;
    ind = b;
  }
};
priority_queue<node> que;
bool operator<(const node &a, const node &b) { return a.str > b.str; }
int main() {
  string s;
  int k = 0;
  cin >> s >> k;
  for (int i = 0; i < (int)s.length(); i++) {
    node tmp;
    tmp.str = s[i];
    tmp.ind = i;
    que.push(tmp);
  }
  string ans;
  while (k--) {
    if (que.empty()) break;
    node tmp = que.top();
    if (k == 0) ans = tmp.str;
    que.pop();
    if (tmp.ind + 1 < (int)s.length()) {
      tmp.str += s[++tmp.ind];
      que.push(tmp);
    }
  }
  if (k == -1)
    cout << ans << endl;
  else
    cout << "No such line." << endl;
  return 0;
}
