#include <bits/stdc++.h>
using namespace std;
const int Alpha = 28;
class SuffixAutomata {
 public:
  struct state {
    int len, link;
    int next[Alpha];
    long long tot;
    long long dp;
    long long ct;
    state() {
      len = link = tot = dp = ct = 0;
      memset(next, -1, sizeof(next));
    }
  };
  vector<int> tp;
  vector<int> vis;
  int sz = 1, last = 0;
  vector<state> st;
  vector<int> terminal;
  void Init(int len) {
    st.clear();
    terminal.clear();
    st.resize(2 * len);
    vis.resize(2 * len);
    terminal.resize(2 * len);
    sz = 1;
    last = 0;
    st[0].len = 0;
    st[0].link = -1;
  }
  void extend(char ccc) {
    int c = ccc - 'a';
    int cur = sz++;
    st[cur].len = st[last].len + 1;
    st[cur].ct = 1;
    int p = last;
    while (p != -1 && st[p].next[c] == -1) {
      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].ct = 0;
        for (int j = 0; j < Alpha; j++) st[clone].next[j] = st[q].next[j];
        st[clone].link = st[q].link;
        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 getTerminal() {
    int p = last;
    while (p > 0) terminal[p] = 1, p = st[p].link;
  }
  void build(string s) {
    Init(s.size());
    for (auto x : s) extend(x);
    getTerminal();
  }
  void dfs(int v) {
    vis[v] = 1;
    for (int i = 0; i < Alpha; i++) {
      if (st[v].next[i] != -1) {
        long long to = st[v].next[i];
        if (!vis[to]) dfs(to);
      }
    }
    tp.push_back(v);
  }
  void dfs2(int v) {
    vis[v] = 1;
    st[v].dp = st[v].ct;
    for (int i = 0; i < Alpha; i++) {
      if (st[v].next[i] != -1) {
        long long to = st[v].next[i];
        if (!vis[to]) dfs2(to);
        st[v].dp += st[to].dp;
      }
    }
  }
  string sol;
  bool can;
  void dfs3(int v, long long kk) {
    if (kk <= st[v].ct) {
      can = true;
      return;
    }
    kk -= (st[v].ct);
    for (int i = 0; i < Alpha; i++) {
      if (st[v].next[i] != -1) {
        long long to = st[v].next[i];
        if (st[to].dp >= kk) {
          sol += (i + 'a');
          dfs3(to, kk);
          return;
        } else {
          kk -= st[to].dp;
        }
      }
    }
  }
  string solve(long long k) {
    dfs(0);
    reverse(tp.begin(), tp.end());
    vis.clear();
    vis.resize(st.size());
    st[0].tot = 1;
    vector<pair<long long, long long> > ww;
    for (int i = 1; i < st.size(); i++) {
      ww.push_back({st[i].len, i});
    }
    sort(ww.rbegin(), ww.rend());
    for (int i = 0; i < ww.size(); i++) {
      long long id = ww[i].second;
      if (st[id].link != -1 && st[id].link != 0) {
        long long to = st[id].link;
        st[to].ct += st[id].ct;
      }
    }
    for (int i = 0; i < tp.size(); i++) {
      long long id = tp[i];
      for (int j = 0; j < Alpha; j++) {
        long long to = st[id].next[j];
        if (to != -1) {
          st[to].tot += st[id].tot;
        }
      }
    }
    sol = "";
    can = false;
    dfs2(0);
    dfs3(0, k);
    if (can) return sol;
    return "No such line.";
  }
};
int main() {
  ios::sync_with_stdio(false);
  SuffixAutomata x;
  string s;
  cin >> s;
  long long k;
  cin >> k;
  x.build(s);
  cout << x.solve(k) << endl;
  return 0;
}
