#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 7;
int n, k;
long long cnt[26];
string s;
vector<int> pos[26], cur;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> s;
  n = (int)s.length();
  cin >> k;
  long long cal = 1LL * n * (n + 1);
  if (cal < 2LL * k) return cout << "No such line.", 0;
  for (int i = 0; i < n; i++) {
    pos[s[i] - 'a'].push_back(i);
    cnt[s[i] - 'a'] += n - i;
  }
  while (1) {
    int p = 0;
    for (int i = 0; i < 26; i++) {
      if (k > cnt[i]) {
        k -= cnt[i];
        continue;
      }
      cur = pos[i];
      char p = 'a' + i;
      cout << p;
      break;
    }
    k -= (int)cur.size();
    if (k <= 0) break;
    for (int i = 0; i < 26; i++) cnt[i] = 0, pos[i].clear();
    bool out = true;
    for (int x : cur) {
      x++;
      if (x >= n) continue;
      out = false;
      pos[s[x] - 'a'].push_back(x);
      cnt[s[x] - 'a'] += n - x;
    }
    if (out) break;
  }
}
