#include <bits/stdc++.h>
using namespace std;
struct node {
  string s;
  int T;
  bool operator<(node a) const { return a.s < s; }
};
priority_queue<node> que;
char str[100010];
int num;
node tmp;
int len;
void solve() {
  while (que.size() != 0) que.pop();
  for (int i = 0; i < len; i++) {
    tmp.T = i;
    tmp.s = str[i];
    que.push(tmp);
  }
  while (que.size() != 0) {
    tmp = que.top();
    que.pop();
    num--;
    if (num == 0) {
      cout << tmp.s << endl;
      return;
    }
    tmp.T++;
    if (tmp.T == len) continue;
    tmp.s += str[tmp.T];
    que.push(tmp);
  }
  printf("No such line.\n");
}
int main() {
  scanf("%s", str);
  len = strlen(str);
  scanf("%d", &num);
  solve();
  return 0;
}
