#include <bits/stdc++.h>
using namespace std;
struct Node {
  string s;
  int pos;
  Node(int _pos, string _s) {
    pos = _pos;
    s = _s;
  }
};
bool operator<(Node A, Node B) {
  if (A.s > B.s)
    return 1;
  else
    return 0;
}
priority_queue<Node> P;
int N, K;
char S[1000000];
int main() {
  gets(S + 1);
  N = strlen(S + 1);
  scanf("%d", &K);
  if (K > (long long)(N + 1) * N / 2)
    puts("No such line.");
  else {
    string ts;
    for (int i = 1; i <= N; i++) {
      ts.clear();
      ts = S[i];
      P.push(Node(i + 1, ts));
    }
    for (int i = 1; i < K; i++) {
      Node tmp = P.top();
      P.pop();
      if (tmp.pos <= N) tmp.s += S[tmp.pos++], P.push(tmp);
    }
    cout << P.top().s << endl;
  }
}
