#include <bits/stdc++.h>
using namespace std;
string st;
string temp;
pair<string, int> temp2;
priority_queue<pair<string, int>, vector<pair<string, int> >,
               greater<pair<string, int> > >
    s;
int main() {
  int i, j, k, l, m, n, x, y, z, a, b, r;
  cin >> st;
  n = st.length();
  scanf("%d", &k);
  for (i = 0; i < n; i++) {
    temp.clear();
    temp.push_back(st[i]);
    s.push(make_pair(temp, i + 1));
  }
  while (s.size() > 0 && k - 1 > 0) {
    temp2 = s.top();
    s.pop();
    k--;
    if (temp2.second < n) {
      temp2.first.push_back(st[temp2.second]);
      (temp2.second)++;
      s.push(temp2);
    }
  }
  if (s.size() == 0)
    printf("No such line.\n");
  else {
    cout << s.top().first << endl;
  }
  return 0;
}
