#include <bits/stdc++.h>
using namespace std;
struct SA {
  struct state {
    long long len, link, nxt[26], c;
    state() : len(0), link(-1), c(0) { fill(begin(nxt), end(nxt), 0); }
  };
  vector<state> d;
  long long last = 0;
  SA() { d.push_back(state()); }
  void add(char ch) {
    long long cur = d.size();
    d.push_back(state());
    d[cur].len = d[last].len + 1;
    long long p = last;
    while (p != -1 && !d[p].nxt[ch - 'a']) {
      d[p].nxt[ch - 'a'] = cur;
      p = d[p].link;
    }
    if (p == -1) {
      d[cur].link = 0;
    } else {
      long long q = d[p].nxt[ch - 'a'];
      if (d[q].len == d[p].len + 1) {
        d[cur].link = q;
      } else {
        long long clone = d.size();
        d.push_back(d[q]);
        d[clone].len = d[p].len + 1;
        d[clone].c = 1;
        while (p != -1 && d[p].nxt[ch - 'a'] == q) {
          d[p].nxt[ch - 'a'] = clone;
          p = d[p].link;
        }
        d[cur].link = d[q].link = clone;
      }
    }
    last = cur;
  }
};
const long long N = 3e5 + 7;
SA sa;
long long cnt[N], dp[N];
vector<long long> adj[N];
void dfs(long long v) {
  for (long long u : adj[v]) {
    dfs(u);
    cnt[v] += cnt[u];
  }
}
long long f(long long v) {
  if (~dp[v]) {
    return dp[v];
  }
  long long ans = cnt[v];
  for (long long i = 0; i < 26; i++) {
    if (sa.d[v].nxt[i]) {
      ans += f(sa.d[v].nxt[i]);
    }
  }
  return dp[v] = ans;
}
string find(long long v, long long k) {
  k -= cnt[v];
  if (k <= 0) {
    return "";
  }
  for (long long i = 0; i < 26; i++) {
    if (sa.d[v].nxt[i]) {
      long long x = f(sa.d[v].nxt[i]);
      if (x >= k) {
        return string(1, i + 'a') + find(sa.d[v].nxt[i], k);
      } else {
        k -= x;
      }
    }
  }
  return "";
}
int32_t main() {
  ios_base ::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long z;
  string str;
  cin >> str >> z;
  for (auto ch : str) {
    sa.add(ch);
  }
  for (long long i = 1; i < sa.d.size(); i++) {
    adj[sa.d[i].link].push_back(i);
    cnt[i] = !sa.d[i].c;
  }
  memset(dp, -1, sizeof dp);
  dfs(0);
  z += cnt[0];
  if (f(0) < z) {
    cout << "No such line." << endl;
  } else {
    cout << find(0, z) << endl;
  }
}
