#include <bits/stdc++.h>
using namespace std;
class substr {
 public:
  string str;
  int id;
  bool operator<(const substr &a) const { return str > a.str; }
};
priority_queue<substr> Q;
int main() {
  string s;
  int k, n;
  cin >> s >> k;
  n = s.length();
  for (int i = 0; i < n; i++) {
    substr a;
    a.str = s[i];
    a.id = i;
    Q.push(a);
  }
  while (!Q.empty()) {
    substr p;
    p = Q.top();
    Q.pop();
    k--;
    if (!k) {
      cout << p.str << endl;
      return 0;
    }
    if (p.id != n - 1) {
      p.str = p.str + s[p.id + 1];
      p.id = p.id + 1;
      Q.push(p);
    }
  }
  cout << "No such line." << endl;
  return 0;
}
