#include <bits/stdc++.h>
using namespace std;
int k;
long long a[256];
int cnt[256];
char ans[120000];
char str[120000];
int p[2][120000];
int plen[2];
int main() {
  ios_base::sync_with_stdio(false);
  cin >> str;
  cin >> k;
  int n = strlen(str);
  if (k > (long long)n * (n + 1) / 2) {
    cout << "No such line." << endl;
    return 0;
  }
  int curp = 0;
  for (int i = 0; i < (int)(n); i++) {
    a[str[i]] += n - i;
    cnt[str[i]]++;
    p[curp][plen[curp]++] = i;
  }
  int tans = 0;
  while (k > 0) {
    long long cur = 0;
    char ch;
    for (ch = 'a'; ch <= 'z'; ++ch) {
      cur += a[ch];
      if (cur >= k) break;
    }
    ans[tans++] = ch;
    k = (k - cur + a[ch] - cnt[ch]);
    plen[1 - curp] = 0;
    for (int i = 0; i < (int)(plen[curp]); i++) {
      if (str[p[curp][i]] == ch && p[curp][i] + 1 < n)
        p[1 - curp][plen[1 - curp]++] = p[curp][i] + 1;
    }
    curp = 1 - curp;
    memset(a, 0, sizeof(a));
    memset(cnt, 0, sizeof(cnt));
    for (int j = 0; j < (int)(plen[curp]); j++) {
      int i = p[curp][j];
      a[str[i]] += n - i;
      cnt[str[i]]++;
    }
  }
  ans[tans] = 0;
  cout << ans << endl;
  return 0;
}
