#include <bits/stdc++.h>
using namespace std;
vector<int> vet[2][30];
long long cnt[30];
char str[100010];
int n, m;
string res;
void init(int cur) {
  int i, j, k;
  for (i = 0; i < 26; i++) {
    vet[cur][i].clear();
    cnt[i] = 0;
  }
}
int main() {
  int i, j, k;
  int cur;
  long long sum;
  while (scanf("%s", str) != EOF) {
    n = strlen(str);
    scanf("%d", &m);
    sum = n;
    sum *= (1 + n);
    sum /= 2;
    if (m > sum) {
      printf("No such line.\n");
      continue;
    }
    cur = 0;
    init(0);
    for (i = 0; i < n; i++) {
      vet[cur][str[i] - 'a'].push_back(i);
      cnt[str[i] - 'a'] += n - i;
    }
    res = "";
    int t = 0;
    while (m) {
      sum = 0;
      for (i = 0; i < 26; i++) {
        if (sum + cnt[i] >= m) {
          m -= sum;
          break;
        } else
          sum += cnt[i];
      }
      if (m <= vet[cur][i].size()) {
        res += 'a' + i;
        m = 0;
        break;
      } else {
        res += 'a' + i;
        m -= vet[cur][i].size();
      }
      init(1 - cur);
      for (k = 0; k < vet[cur][i].size(); k++) {
        j = vet[cur][i][k] + 1;
        if (j >= n) continue;
        vet[1 - cur][str[j] - 'a'].push_back(j);
        cnt[str[j] - 'a'] += n - j;
      }
      cur = 1 - cur;
    }
    cout << res << endl;
  }
  return 0;
}
