#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1000 * 100 + 100;
struct iman {
  string s;
  int ind;
  bool operator<(const iman &x) const { return s > x.s; }
};
int k, l;
string s1;
char s3[MAXN];
iman x;
priority_queue<iman> Q;
void print() {
  while (!Q.empty()) {
    x = Q.top();
    Q.pop();
    k--;
    if (k == 0) {
      cout << x.s << endl;
      return;
    }
    if (x.ind < l) {
      x.s = x.s + s1[x.ind];
      x.ind++;
      Q.push(x);
    }
  }
  cout << "No such line.\n";
  return;
}
int main() {
  ios::sync_with_stdio(false);
  cin >> s1 >> k;
  l = s1.size();
  for (int i = 0; i < l; i++) {
    x.s = s1[i];
    x.ind = i + 1;
    Q.push(x);
  }
  print();
  return 0;
}
