#include <bits/stdc++.h>
using namespace std;
template <typename S, typename T>
ostream& operator<<(ostream& out, pair<S, T> const& p) {
  out << '(' << p.first << ", " << p.second << ')';
  return out;
}
template <typename T>
ostream& operator<<(ostream& out, vector<T> const& v) {
  long long l = v.size();
  for (long long i = 0; i < l - 1; i++) out << v[i] << ' ';
  if (l > 0) out << v[l - 1];
  return out;
}
template <typename T>
void trace(const char* name, T&& arg1) {
  cout << name << " : " << arg1 << "\n";
}
template <typename T, typename... Args>
void trace(const char* names, T&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cout.write(names, comma - names) << " : " << arg1 << " | ";
  trace(comma + 1, args...);
}
set<pair<string, long long> > si;
string s;
long long k, n;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> s;
  cin >> k;
  n = s.size();
  if (((n * (n + 1)) / 2) < k) {
    cout << "No such line.\n";
    return 0;
  }
  for (long long i = 0; i < n; i++) {
    string temp = "";
    temp += s[i];
    si.insert(make_pair(temp, i));
  }
  k--;
  pair<string, long long> temp;
  set<pair<string, long long> >::iterator it;
  while (k--) {
    it = si.begin();
    temp = *it;
    si.erase(it);
    if (temp.second < n - 1) {
      string q = temp.first + s[temp.second + 1];
      si.insert(make_pair(q, temp.second + 1));
    }
  }
  cout << (*(si.begin())).first << "\n";
  return 0;
}
