#include <bits/stdc++.h>
using namespace std;
struct SAM {
  int tot, last, m;
  int pre[100010 << 1], go[100010 << 1][26], step[100010 << 1];
  long long sz[100010 << 1], same[100010 << 1];
  int head[100010 << 1], next[100010 * 2 * 26], ch[100010 * 2 * 26];
  void new_node(int s) {
    step[++tot] = s;
    pre[tot] = 0;
    same[tot] = 0;
    memset(go[tot], 0, sizeof go[tot]);
  }
  void build(char* s) {
    tot = 0;
    last = 1;
    new_node(0);
    int n = strlen(s);
    for (int i = 0; i <= n - 1; ++i) {
      new_node(step[last] + 1);
      same[tot] = 1;
      int c = s[i] - 'a';
      int p = last, np = tot, q, nq;
      for (; p && !go[p][c]; p = pre[p]) go[p][c] = np;
      if (!p)
        pre[np] = 1;
      else {
        q = go[p][c];
        if (step[q] == step[p] + 1)
          pre[np] = q;
        else {
          new_node(step[p] + 1);
          same[tot] = 0;
          nq = tot;
          memcpy(go[nq], go[q], sizeof go[q]);
          pre[nq] = pre[q];
          pre[np] = pre[q] = nq;
          for (; p && go[p][c] == q; p = pre[p]) go[p][c] = nq;
        }
      }
      last = np;
    }
    m = 0;
    for (int i = 1; i <= tot; ++i)
      for (int j = 25; j >= 0; --j) {
        if (go[i][j]) {
          ch[++m] = j;
          next[m] = head[i];
          head[i] = m;
        }
      }
  }
  void get_same() {
    queue<int> q;
    vector<int> degree(tot + 1);
    for (int i = 1; i <= tot; ++i) degree[pre[i]]++;
    for (int i = tot; i >= 1; --i)
      if (!degree[i]) q.push(i);
    while (!q.empty()) {
      int x = q.front();
      q.pop();
      if (!--degree[pre[x]]) q.push(pre[x]);
      same[pre[x]] += same[x];
    }
  }
  void dfs(int x) {
    sz[x] = same[x];
    for (int i = head[x]; i; i = next[i]) {
      int y = go[x][ch[i]];
      if (y && !sz[y]) dfs(y);
      sz[x] += sz[y];
    }
  }
  void findkth(int k) {
    int p = 1;
    while (k > 0) {
      for (int j = head[p]; j; j = next[j]) {
        int i = ch[j];
        if (k <= sz[go[p][i]]) {
          k -= same[go[p][i]];
          putchar(i + 'a');
          p = go[p][i];
          break;
        } else {
          k -= sz[go[p][i]];
        }
      }
    }
    cout << endl;
  }
};
char S[100010];
int k;
SAM run;
int main() {
  scanf("%s%d", S, &k);
  run.build(S);
  run.get_same();
  run.dfs(1);
  int cnt = 0;
  if (k > run.sz[1] - run.same[1])
    printf("No such line.\n");
  else
    run.findkth(k);
  return 0;
}
