#include <bits/stdc++.h>
struct SuffixTrie {
  int start, end;
  SuffixTrie* next[64];
  SuffixTrie* link;
  SuffixTrie* father;
  int flag;
  int length;
  int paths;
};
struct ST {
  SuffixTrie root;
  SuffixTrie nodes[200010];
  int totNode;
  int W[3];
  SuffixTrie *P, *G, *U, *V, *q;
  int len;
  void createNode(SuffixTrie*& Node) {
    Node = &nodes[totNode++];
    Node->start = Node->end = Node->length = -1;
    for (int i = 0; i < 64; i++) Node->next[i] = NULL;
    Node->link = Node->father = NULL;
    Node->flag = 1;
  }
  void init(char s[]) {
    totNode = 0;
    root.start = root.end = -1;
    for (int i = 0; i < 64; i++) root.next[i] = NULL;
    root.link = &root;
    root.father = NULL;
    root.flag = 1;
    root.length = 0;
    len = strlen(s);
    s[len] = 63;
    s[len + 1] = '\0';
    len++;
    buildSuffixTrie(s);
  }
  int findV(char s[]) {
    int old;
    SuffixTrie *t, *newt;
    t = U->next[s[W[0]] - 1];
    old = 0;
    while (W[2] > (t->end) - (t->start) + 1 + old) {
      old += (t->end - t->start + 1);
      t = t->next[s[W[0] + old] - 1];
    }
    if (W[2] == (t->end) - (t->start) + 1 + old) {
      V = t;
      P->link = V;
      return 1;
    } else {
      createNode(newt);
      newt->start = t->start;
      newt->end = t->start + W[2] - old - 1;
      newt->father = t->father;
      newt->length = newt->father->length + newt->end - newt->start + 1;
      t->father->next[s[t->start] - 1] = newt;
      t->start = newt->end + 1;
      newt->next[s[t->start] - 1] = t;
      t->father = newt;
      V = newt;
      P->link = V;
      return 2;
    }
  }
  int insert(SuffixTrie* Node, int start, char s[]) {
    int i, posbegin, posend;
    SuffixTrie* t;
    if (Node->next[s[start] - 1] == NULL) {
      createNode(Node->next[s[start] - 1]);
      Node->next[s[start] - 1]->start = start;
      Node->next[s[start] - 1]->end = len - 1;
      Node->next[s[start] - 1]->father = Node;
      Node->next[s[start] - 1]->length = Node->length + len - start;
      Node->flag = 2;
      P = Node;
      return 1;
    } else {
      posbegin = Node->next[s[start] - 1]->start;
      posend = Node->next[s[start] - 1]->end;
      for (i = posbegin; i <= posend; i++) {
        if (s[i] != s[start + i - posbegin]) break;
      }
      if (i == posend + 1) {
        return insert(Node->next[s[start] - 1], start + i - posbegin, s);
      } else {
        createNode(t);
        t->start = posbegin;
        t->end = i - 1;
        t->flag = 2;
        Node->next[s[start] - 1]->start = i;
        t->next[s[i] - 1] = Node->next[s[start] - 1];
        t->next[s[i] - 1]->father = t;
        Node->next[s[start] - 1] = t;
        t->father = Node;
        t->length = Node->length + t->end - t->start + 1;
        insert(t, start + i - posbegin, s);
        G = Node;
        P = t;
        return 2;
      }
    }
  }
  int select(int start, char s[], int type) {
    int result1, result2, result;
    if (type == 1) {
      U = P->link;
      result = insert(U, start + U->length, s);
    } else {
      U = G->link;
      if (G->link == G) {
        W[0] = P->start + 1;
        W[1] = P->end;
        W[2] = P->end - P->start;
      } else {
        W[0] = P->start;
        W[1] = P->end;
        W[2] = P->end - P->start + 1;
      }
      if (W[2] == 0) {
        V = G;
        P->link = V;
        result = insert(V, start, s);
      } else {
        result1 = findV(s);
        result2 = insert(V, start + V->length, s);
        if (result1 == 2) {
          G = P->father;
          result = result1;
        } else
          result = result2;
      }
    }
    return result;
  }
  void buildSuffixTrie(char s[]) {
    int type;
    len = strlen(s);
    createNode(root.next[s[0] - 1]);
    root.next[s[0] - 1]->start = 0;
    root.next[s[0] - 1]->end = len - 1;
    root.next[s[0] - 1]->father = &root;
    root.next[s[0] - 1]->length =
        root.length + root.next[s[0] - 1]->end - root.next[s[0] - 1]->start + 1;
    root.flag = 2;
    type = 1;
    P = &root;
    for (int i = 1; i < len; i++) type = select(i, s, type);
  }
} st;
char ret[100010];
char str[100010];
int k;
bool find(SuffixTrie* p, int len) {
  int b = p->paths;
  int tl = ((p->flag == 1) ? p->end - p->start : p->end - p->start + 1);
  if (p == &st.root) tl = 0;
  if (tl * b >= k) {
    int tt = 0;
    int i = 0;
    while (tt < k) {
      ret[len + i] = str[p->start + i];
      i++;
      tt += b;
    }
    ret[len + i] = '\0';
    puts(ret);
    return true;
  }
  k -= tl * b;
  for (int i = p->start; i < p->start + tl; i++) ret[len++] = str[i];
  for (int i = 0; i < 64; i++)
    if (p->next[i] != NULL && i != 63) {
      if (find(p->next[i], len) == true) return true;
    }
  return false;
}
int dp(SuffixTrie* p) {
  int cnt = 0;
  if (p->flag == 1) {
    p->paths = 1;
    return 1;
  }
  for (int i = 0; i < 64; i++)
    if (p->next[i] != NULL) cnt += dp(p->next[i]);
  p->paths = cnt;
  return p->paths;
}
char str2[100010];
int main() {
  scanf("%s%d", str, &k);
  int len = strlen(str);
  if (k > (long long)(len + 1) * len / 2) {
    puts("No such line.");
    return 0;
  }
  for (int i = 0; str[i]; i++) str2[i] = str[i] - 'a' + 1;
  str2[len] = '\0';
  st.init(str2);
  dp(&st.root);
  find(&st.root, 0);
}
