#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5, M = 8e5 + 9, MOD = 1e9 + 7;
long long freq[26];
int arr[N], n;
set<int> st[26][N];
string str, ans;
bool go(int idx) {
  if (idx == ((int)str.size())) return 0;
  for (int i = 0; i < 26; ++i) {
    if (!st[i][idx].empty()) {
      n -= st[i][idx].size();
      if (n <= 0) {
        ans.push_back(char(i + 'a'));
        return 1;
      }
      while (!st[i][idx].empty()) {
        if ((*st[i][idx].begin()) + idx + 1 < ((int)str.size()))
          st[str[(*st[i][idx].begin()) + idx + 1] - 'a'][idx + 1].insert(
              *st[i][idx].begin());
        st[i][idx].erase(st[i][idx].begin());
      }
      if (go(idx + 1)) {
        ans.push_back(char(i + 'a'));
        return 1;
      }
    }
  }
  return 0;
}
void runtestcase() {
  cin >> str;
  cin >> n;
  for (int i = 0; i < ((int)str.size()); ++i)
    freq[str[i] - 'a'] += ((int)str.size()) - i;
  int x = 0;
  for (; x < 26; ++x) {
    if (freq[x] >= n) break;
    n -= freq[x];
  }
  set<pair<pair<int, int>, int>> start;
  for (int i = 0; i < ((int)str.size()); ++i) {
    if (str[i] - 'a' == x) {
      st[x][0].insert(i);
    }
  }
  go(0);
  if (n > 0)
    cout << "No such line.";
  else {
    reverse(ans.begin(), ans.end());
    cout << ans;
  }
}
int main() {
  cout << fixed << setprecision(0), ios::sync_with_stdio(false),
      cin.tie(nullptr), cout.tie(nullptr);
  int t = 1, tt = 1;
  while (t) {
    runtestcase();
    if (t) cout << '\n';
    --t, ++tt;
  }
}
