#include <bits/stdc++.h>
class SAM {
 private:
  static const int maxn = 1e5 + 7;
  struct Node {
    int len;
    long long size, sum;
    Node *link, *next[26];
    Node() {}
    Node(int len) : len(len), size(0), sum(0), link(nullptr) {
      memset(next, 0, sizeof(next));
    }
  };
  int n, sum[maxn], id[maxn << 1], cnt;
  Node *root, *last, *tp, pool[maxn << 1];
  Node *newNode(int len = 0) {
    *++tp = Node(len);
    return tp;
  }
  void extend(int x) {
    Node *now = newNode(last->len + 1), *p = last;
    now->size = 1;
    for (; p && !p->next[x]; p = p->link) {
      p->next[x] = now;
    }
    if (!p) {
      now->link = root;
    } else {
      Node *q = p->next[x];
      if (p->len + 1 == q->len) {
        now->link = q;
      } else {
        Node *clone = newNode();
        *clone = *q, clone->len = p->len + 1, clone->size = 0;
        for (; p && p->next[x] == q; p = p->link) {
          p->next[x] = clone;
        }
        now->link = q->link = clone;
      }
    }
    last = now;
  }

 public:
  void init(char *s) {
    n = strlen(s + 1);
    tp = pool;
    root = last = newNode();
    for (register int i = 1; i <= n; i++) {
      extend(s[i] - 'a');
    }
    for (register Node *now = tp; now != pool; now--) {
      sum[now->len]++;
    }
    root->size = 0;
    for (register int i = 1; i <= n; i++) {
      sum[i] += sum[i - 1];
    }
    cnt = sum[n];
    for (register Node *now = tp; now != pool; now--) {
      id[sum[now->len]--] = now - pool;
    }
    for (register int i = cnt; i; i--) {
      Node *now = pool + id[i];
      if (now->link) {
        now->link->size += now->size;
      }
    }
    for (register int i = cnt; i; i--) {
      Node *now = pool + id[i];
      now->sum = now->size;
      for (register int i = 0; i < 26; i++) {
        if (now->next[i]) {
          now->sum += now->next[i]->sum;
        }
      }
    }
  }
  void query(int k) {
    if (root->sum < k) {
      puts("No such line.");
      return;
    }
    for (register Node *now = root; k > 0; k -= now->size) {
      int p = 0;
      while (k > (now->next[p] ? now->next[p]->sum : 0)) {
        if (!now->next[p]) {
          p++;
          continue;
        }
        k -= now->next[p++]->sum;
      }
      putchar('a' + p);
      now = now->next[p];
    }
    putchar('\n');
  }
};
class Solution {
 private:
  static const int maxn = 1e5 + 7;
  ;
  int n, k;
  char s[maxn];
  SAM sam;

 public:
  Solution() {
    get();
    solve();
  }
  void get() {
    scanf("%s", s + 1);
    scanf("%d", &k);
  }
  void solve() {
    sam.init(s);
    sam.query(k);
  }
};
Solution sol;
int main() {}
