#include <bits/stdc++.h>
using namespace std;
struct sl {
  string s;
  long l;
} a;
bool operator<(sl a, sl b) { return a.s > b.s; }
long i, j, n, k, xl, yl, x, y;
priority_queue<sl> b;
string str;
int main() {
  cin >> str >> k;
  n = str.size();
  for (i = 0; i < n; i++) {
    a.s = str[i];
    a.l = i;
    b.push(a);
  }
  if ((long long)n * (n + 1) / 2 < k) {
    printf("No such line.");
    return 0;
  }
  while (k--) {
    a = b.top();
    b.pop();
    if (!k) {
      cout << a.s;
      return 0;
    }
    if (a.l + 1 < n) {
      a.l++;
      a.s += str[a.l];
      b.push(a);
    }
  }
  return 0;
}
