#include <bits/stdc++.h>
using namespace std;
char str[100005];
int cnt[26];
long long sum[26];
int main() {
  str[0] = 0;
  while (scanf("%s", str + 1) != EOF) {
    int len = strlen(str + 1);
    int K;
    scanf("%d", &K);
    if ((long long)(len) * (len + 1) / 2 < K) {
      puts("No such line.");
      continue;
    }
    vector<int> active;
    for (int i = 1; i <= len; i++) {
      active.push_back(i);
    }
    while (K > 0) {
      memset(cnt, 0, sizeof(cnt));
      memset(sum, 0, sizeof(sum));
      for (vector<int>::iterator it = active.begin(); it != active.end();
           it++) {
        int i = *it;
        cnt[str[i] - 'a']++;
        sum[str[i] - 'a'] += len - i + 1;
      }
      int i;
      for (i = 0; i < 26; i++) {
        if (sum[i] < K) {
          K -= sum[i];
        } else {
          break;
        }
      }
      putchar('a' + i);
      K -= cnt[i];
      vector<int> tmp;
      for (vector<int>::iterator it = active.begin(); it != active.end();
           it++) {
        int j = *it;
        if (str[j] == 'a' + i && j + 1 <= len) {
          tmp.push_back(j + 1);
        }
      }
      active = tmp;
    }
    puts("");
  }
  return 0;
}
