#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
priority_queue<pair<string, int>, vector<pair<string, int> >,
               greater<pair<string, int> > >
    q;
int main() {
  int k;
  string str;
  while (cin >> str >> k) {
    while (!q.empty()) q.pop();
    int len = str.size();
    for (int i = 0; i < len; i++) {
      q.push({str.substr(i, 1), i});
    }
    string ans;
    int flag = 0;
    while (k--) {
      if (q.empty()) {
        puts("No such line.");
        flag = 1;
        break;
      }
      pair<string, int> tmp = q.top();
      q.pop();
      ans = tmp.first;
      if (ans.size() == len - tmp.second) continue;
      q.push({str.substr(tmp.second, ans.size() + 1), tmp.second});
    }
    if (!flag) cout << ans << endl;
  }
}
