#include <bits/stdc++.h>
using namespace std;
const int N = 100005;
string str;
struct SB {
  string s;
  int v;
  SB() {}
  SB(string s, int v) {
    this->s = s;
    this->v = v;
  }
  bool operator<(const SB& c) const {
    if (s == c.s) {
      return s + str[v + 1] > c.s + str[c.v + 1];
    }
    return s > c.s;
  }
};
priority_queue<SB> Q;
int k;
int main() {
  cin >> str >> k;
  str += "";
  int n = str.length();
  if ((long long)n * (n + 1) / 2 < (long long)k) {
    printf("No such line.\n");
    return 0;
  }
  str += ('a' - 1);
  for (int i = 0; i < n; i++) {
    string sb = "";
    Q.push(SB(sb + str[i], i));
  }
  SB u;
  for (int i = 0; i < k; i++) {
    u = Q.top();
    Q.pop();
    if (u.v + 1 == n) continue;
    Q.push(SB(u.s + str[u.v + 1], u.v + 1));
  }
  cout << u.s << endl;
  return 0;
}
