#include <bits/stdc++.h>
using namespace std;
struct node {
  string s;
  int loc;
  bool operator<(const node& rhs) const { return s > rhs.s; }
} s, t;
priority_queue<node> q;
char ch[1000005];
int main() {
  while (scanf("%s", ch + 1) != EOF) {
    long long len = strlen(ch + 1);
    int n;
    cin >> n;
    for (int i = 1; i <= len; i++) {
      string ss;
      ss += ch[i];
      s.s = ss, s.loc = i;
      q.push(s);
    }
    int cnt = 0;
    if (((len + 1) * len) / 2 < n)
      cout << "No such line.\n";
    else {
      while (!q.empty()) {
        t = q.top();
        q.pop();
        cnt++;
        if (cnt == n) {
          cout << t.s << '\n';
          break;
        } else {
          int l = t.loc;
          if (l + 1 <= len) {
            t.s += ch[l + 1];
            t.loc += 1;
            q.push(t);
          }
        }
      }
    }
  }
  return 0;
}
