#include <bits/stdc++.h>
using namespace std;
const int maxn = 100005;
struct node {
  int lastIndex;
  string s;
};
string s;
priority_queue<node> q;
int k;
bool operator<(node x, node y) {
  if (x.s == y.s) return s[x.lastIndex + 1] > s[y.lastIndex + 1];
  return x.s > y.s;
}
int main() {
  int i;
  while (cin >> s) {
    scanf("%d", &k);
    int l = s.length();
    if ((long long)l * (l + 1) / 2 < (long long)k) {
      cout << "No such line." << endl;
      continue;
    }
    while (!q.empty()) q.pop();
    for (i = 0; i < l; i++) {
      node tmp;
      tmp.lastIndex = i;
      tmp.s.push_back(s[i]);
      q.push(tmp);
    }
    int t = 0;
    while (1) {
      node p = q.top();
      q.pop();
      t++;
      if (t == k) {
        cout << p.s << endl;
        break;
      }
      if (p.lastIndex != l - 1) {
        p.lastIndex++;
        p.s.push_back(s[p.lastIndex]);
        q.push(p);
      }
    }
  }
  return 0;
}
