#include <bits/stdc++.h>
using namespace std;
const long long MAX_N = 100005ll;
char temp[MAX_N];
int n, k;
string str;
priority_queue<pair<string, int>, vector<pair<string, int> >,
               greater<pair<string, int> > >
    Q;
int main(int argc, const char* argv[]) {
  ios_base::sync_with_stdio(false), cin.tie();
  cin >> str >> k;
  n = (int)str.size();
  for (int(i) = (0); i <= (long long)(n - 1); (i)++)
    Q.push({string(1, str[i]), i});
  while (--k && !Q.empty()) {
    pair<string, int> cur = Q.top();
    Q.pop();
    if (cur.second < n - 1)
      Q.push({cur.first + str[cur.second + 1], cur.second + 1});
  }
  if (k)
    printf("No such line.\n");
  else
    cout << Q.top().first << endl;
  return 0;
}
