#include <bits/stdc++.h>
using namespace std;
set<pair<string, int>> box;
string s;
int main() {
  int i, j, x, y, t, n, m, p, k;
  cin >> s;
  scanf("%d", &k);
  n = s.length();
  if (1ll * n * (n + 1) / 2 < 1ll * k) {
    puts("No such line.");
    return 0;
  }
  for (i = 0; i < n; i++) {
    box.insert(make_pair(string(1, s[i]), i));
  }
  while (true) {
    k--;
    if (!k) {
      cout << (*box.begin()).first << endl;
      ;
      return 0;
    }
    auto p = *box.begin();
    box.erase(box.begin());
    if (p.second != n - 1) {
      p.first += s[p.second + 1];
      p.second++;
      box.insert(p);
    }
  }
}
