#include <bits/stdc++.h>
using namespace std;
char s[100005];
list<int> L;
long long k, cnt[26], len;
int main() {
  cin.sync_with_stdio(false);
  cout.sync_with_stdio(false);
  cin.getline(s, 100005);
  len = strlen(s);
  cin >> k;
  if (k > len * (len + 1) / 2) {
    cout << "No such line.\n";
  } else {
    int delta = 0;
    for (int i = 0; i < len; i++) L.push_back(i);
    L.push_back(-1);
    while (true) {
      memset(cnt, 0, sizeof(cnt));
      for (list<int>::iterator it = L.begin(); it != L.end(); it++) {
        int J = *it;
        if (J < 0) continue;
        cnt[s[J + delta] - 'a'] += len - (J + delta);
      }
      int tar = -1;
      for (int i = 0; i < 26; i++) {
        if (cnt[i] >= k) {
          tar = i;
          break;
        } else {
          k -= cnt[i];
        }
      }
      int st, ed;
      while (k > 0) {
        int J = L.front();
        L.pop_front();
        if (J == -1) {
          L.push_back(-1);
          break;
        }
        if (s[J + delta] == tar + 'a') {
          k--;
          if (k == 0) {
            st = J, ed = J + delta;
            for (int i = J; i <= J + delta; i++) printf("%c", s[i]);
            printf("\n");
            return 0;
          }
          if ((J + delta) != (len - 1)) L.push_back(J);
        }
      }
      delta++;
    }
  }
}
