#include <bits/stdc++.h>
using namespace std;
char str[100400];
int len;
long long k;
int r, ret;
long long calc(int x) { return len - x; }
int Q[100400];
char res[100400];
void solve(int x) {
  int i, j;
  for (j = 0; j < 26; j++) {
    long long sum = 0;
    queue<int> q;
    for (i = 0; i < r; i++) {
      if (Q[i] + 1 < len && str[Q[i] + 1] == 'a' + j) {
        sum += calc(Q[i] + 1);
        q.push(Q[i] + 1);
      }
    }
    if (sum >= k) {
      r = 0;
      while (!q.empty()) {
        Q[r++] = q.front();
        q.pop();
      }
      break;
    } else {
      k -= sum;
    }
  }
  res[ret++] = 'a' + j;
  k -= r;
  if (k > 0) solve(j);
}
int main() {
  int i, j;
  while (scanf("%s", str) != EOF) {
    scanf("%d", &k);
    len = strlen(str);
    ret = 0;
    if (k > (1LL * (len + 1) * len) / 2) {
      cout << "No such line." << endl;
      continue;
    }
    for (j = 0; j < 26; j++) {
      long long sum = 0;
      r = 0;
      for (i = 0; i < len; i++) {
        if (str[i] == 'a' + j) {
          sum += calc(i);
          Q[r++] = i;
        }
      }
      if (sum >= k) {
        break;
      } else {
        k -= sum;
      }
    }
    res[ret++] = 'a' + j;
    k -= r;
    if (k > 0) solve(j);
    res[ret] = '\0';
    cout << res << endl;
  }
  return 0;
}
