#include <bits/stdc++.h>
using namespace std;
struct state {
  int len, link, cnt;
  map<char, int> next;
  state() : len(0), link(-1), cnt(0) {}
};
vector<state> st(2000005);
struct suffixAutomaton {
  int sz, last, n;
  priority_queue<pair<int, int> > Q;
  suffixAutomaton(int N) : n(2 * N + 1), last(0), sz(1) {
    st[0].len = 0;
    st[0].link = -1;
  }
  void add(char c) {
    int cur = sz++;
    st[cur].len = st[last].len + 1;
    st[cur].cnt = 1;
    Q.push(pair<int, int>(st[cur].len, cur));
    int p = last;
    while (p != -1 && !st[p].next.count(c)) {
      st[p].next[c] = cur;
      p = st[p].link;
    }
    if (p == -1) {
      st[cur].link = 0;
    } else {
      int q = st[p].next[c];
      if (st[p].len + 1 == st[q].len) {
        st[cur].link = q;
      } else {
        int clone = sz++;
        st[clone].len = st[p].len + 1;
        st[clone].next = st[q].next;
        st[clone].link = st[q].link;
        Q.push(pair<int, int>(st[clone].len, clone));
        while (p != -1 && st[p].next[c] == q) {
          st[p].next[c] = clone;
          p = st[p].link;
        }
        st[q].link = st[cur].link = clone;
      }
    }
    last = cur;
  }
  void precompute() {
    while (!Q.empty()) {
      pair<int, int> temp = Q.top();
      Q.pop();
      int p = st[temp.second].link;
      if (p != -1) {
        st[p].cnt += st[temp.second].cnt;
      }
    }
  }
  void DFS(int idx, int &sum, list<char> &ans) {
    if (idx != 0) sum -= st[idx].cnt;
    if (sum <= 0) return;
    for (auto i : st[idx].next) {
      DFS(i.second, sum, ans);
      if (sum <= 0) {
        ans.push_front(i.first);
        return;
      }
    }
  }
};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  string s;
  int k;
  cin >> s >> k;
  long long len = s.size();
  if (len * (len + 1) / 2 < k) {
    cout << "No such line.\n";
    return 0;
  }
  list<char> answer;
  suffixAutomaton sa(100005);
  for (int i = 0; i < s.size(); i++) {
    sa.add(s[i]);
  }
  sa.precompute();
  sa.DFS(0, k, answer);
  for (char i : answer) {
    cout << i;
  }
  cout << '\n';
  return 0;
}
