#include <bits/stdc++.h>
using namespace std;
const long long int mod = 1000000007;
const long long int inf = 0x3f3f3f3f3f3f3f3fLL;
const double eps = 1e-9;
const double PI = acos(-1);
long long int i, j, k;
void solve(void);
inline bool equal(double a, double b) { return fabs(a - b) < eps; }
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout << fixed << setprecision(10);
  int t = 1;
  while (t--) solve();
  return 0;
}
void solve() {
  string s;
  cin >> s;
  long long int k, n = (long long)s.size();
  cin >> k;
  if (k > (n * (n + 1)) / 2) {
    cout << "No such line.\n";
    return;
  }
  set<pair<string, int> > st;
  for (i = (0); i <= (n - 1); ++i) {
    string t;
    t += s[i];
    st.insert(make_pair(t, i));
  }
  --k;
  while (k--) {
    pair<string, int> p = *st.begin();
    st.erase(st.begin());
    int l = (long long)p.first.size();
    if (p.second + l < n) {
      p.first += s[p.second + l];
      st.insert(p);
    }
  }
  cout << (*st.begin()).first << '\n';
}
