#include <bits/stdc++.h>
using namespace std;
struct suffix {
  int index;
  int Rank[2];
};
int cmp(struct suffix a, struct suffix b) {
  return (a.Rank[0] == b.Rank[0]) ? (a.Rank[1] < b.Rank[1] ? 1 : 0)
                                  : (a.Rank[0] < b.Rank[0] ? 1 : 0);
}
int *buildSuffixArray(char *txt, int n) {
  struct suffix suffixes[n];
  for (int i = 0; i < n; i++) {
    suffixes[i].index = i;
    suffixes[i].Rank[0] = txt[i] - 'a';
    suffixes[i].Rank[1] = ((i + 1) < n) ? (txt[i + 1] - 'a') : -1;
  }
  sort(suffixes, suffixes + n, cmp);
  int ind[n];
  for (int k = 4; k < 2 * n; k = k * 2) {
    int Rank = 0;
    int prev_rank = suffixes[0].Rank[0];
    suffixes[0].Rank[0] = Rank;
    ind[suffixes[0].index] = 0;
    for (int i = 1; i < n; i++) {
      if (suffixes[i].Rank[0] == prev_rank &&
          suffixes[i].Rank[1] == suffixes[i - 1].Rank[1]) {
        prev_rank = suffixes[i].Rank[0];
        suffixes[i].Rank[0] = Rank;
      } else {
        prev_rank = suffixes[i].Rank[0];
        suffixes[i].Rank[0] = ++Rank;
      }
      ind[suffixes[i].index] = i;
    }
    for (int i = 0; i < n; i++) {
      int nextindex = suffixes[i].index + k / 2;
      suffixes[i].Rank[1] =
          (nextindex < n) ? suffixes[ind[nextindex]].Rank[0] : -1;
    }
    sort(suffixes, suffixes + n, cmp);
  }
  int *suffixArr = new int[n];
  for (int i = 0; i < n; i++) suffixArr[i] = suffixes[i].index;
  return suffixArr;
}
const int N = 100005;
char str[N];
int done[N], length[N];
void PRINT(int x, int len) {
  for (int i = x; i <= len - 1; i++) cout << str[i];
  cout << endl;
}
int main() {
  scanf("%s", str);
  int k;
  scanf("%d", &k);
  int n = strlen(str);
  int *ara = buildSuffixArray(str, n);
  for (int i = 0; i < n; i++) length[i] = n - ara[i];
  for (int i = 0; i < n; i++) {
    int match_till = n - 1;
    for (int j = ara[i] + done[i]; j < n; j++) {
      int row = i;
      while (row <= match_till and (i == row or done[i] - 1 == done[row])) {
        int p = done[row];
        if (str[ara[row] + p] == str[j]) {
          k = k - 1;
          done[row]++;
          if (k == 0) {
            PRINT(ara[row], ara[row] + done[row]);
            return 0;
          }
        } else {
          match_till = min(match_till, row);
          break;
        }
        row++;
      }
    }
  }
  cout << "No such line.\n";
}
