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