#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
struct node {
  string str;
  int pos;
  friend bool operator<(node const &a, node const &b) { return a.str > b.str; }
};
priority_queue<node> q1;
int main() {
  int k;
  string a;
  cin >> a;
  cin >> k;
  q1.push({string{'z' + 1}, inf});
  for (int i = 0; i < a.size(); i++) {
    q1.push({string{a[i]}, i});
  }
  node ans;
  while (1) {
    if (q1.empty()) {
      break;
    }
    if (k == 0) {
      break;
    }
    k--;
    ans = q1.top();
    q1.pop();
    if (ans.pos == a.size() - 1 || ans.pos == inf) {
      continue;
    }
    q1.push({ans.str + a[ans.pos + 1], ans.pos + 1});
  }
  if (k != 0) {
    cout << "No such line." << endl;
  } else {
    cout << ans.str << endl;
  }
}
