#include <bits/stdc++.h>
using namespace std;
const int MAXN = 0;
string s;
int N, K;
multiset<pair<string, int> > q;
void solve() {
  cin >> s >> K;
  int N = s.size();
  if (K > 1ll * N * (N + 1) / 2) {
    cout << "No such line." << endl;
    return;
  }
  for (int i = 0; i < N; i++) {
    q.insert({s.substr(i, 1), i});
  }
  K--;
  while (K--) {
    pair<string, int> f = *q.begin();
    q.erase(q.begin());
    if (f.second < N - 1) {
      f.second++;
      q.insert({f.first + s[f.second], f.second});
    }
  }
  pair<string, int> f = *q.begin();
  cout << f.first << endl;
}
void Times(int T) {
  while (T--) {
    solve();
  }
}
int main() {
  int T;
  T = 1;
  Times(T);
  return 0;
}
