#include <bits/stdc++.h>
using namespace std;
char a[100000 + 1];
int K;
class Item {
 public:
  string s;
  int pos;
  Item() {}
  Item(const char ss[], const int ppos) {
    s = ss;
    pos = ppos;
  }
  inline Item operator+=(const char second) {
    s += second;
    return (*this);
  }
  inline void Print() const { cout << s << endl; }
} temp;
inline bool operator>=(const Item &aa, const Item &bb) { return aa.s >= bb.s; }
priority_queue<Item, vector<Item>, greater_equal<Item> > Q;
int main() {
  scanf("%s\n%d", a, &K);
  for (int i = strlen(a) - 1; i >= 0; i--) {
    char Init[2];
    strncpy(Init, a + i, 1);
    Init[1] = '\0';
    Q.push(Item(Init, i + 1));
  }
  for (int i = 1; i < K; i++) {
    if (Q.empty()) break;
    temp = Q.top();
    Q.pop();
    if (a[temp.pos] != '\0') {
      temp += a[(temp.pos)++];
      Q.push(temp);
    }
  }
  if (Q.empty())
    cout << "No such line." << endl;
  else
    (Q.top()).Print();
  return 0;
}
