#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 20;
vector<int> pos['z' - 'a' + 5];
int vis[N];
vector<int> ero[2]['z' - 'a' + 5];
char str[N];
int main() {
  int k;
  scanf("%s%d", str, &k);
  int sz = strlen(str);
  if (k > (1ll * sz * (sz + 1)) / 2) return printf("No such line.\n"), 0;
  for (int i = 0; i < sz; i++) ero[0][str[i] - 'a'].push_back(i + 1);
  int flag = 1;
  bool cur = 0, last = 1;
  while (k > 0) {
    for (char c = 'a'; c <= 'z'; c++) {
      long long int temp = 0, cnt = 0;
      for (int i = 0; i < (int)ero[cur][c - 'a'].size(); i++)
        temp += sz - ero[cur][c - 'a'][i] + 1, cnt++;
      if (temp >= k) {
        for (char i = 'a'; i <= 'z'; i++) ero[last][i - 'a'].clear();
        printf("%c", c);
        for (int i = 0; i < (int)ero[cur][c - 'a'].size(); i++)
          if (ero[cur][c - 'a'][i] + 1 <= sz)
            ero[last][str[ero[cur][c - 'a'][i]] - 'a'].push_back(
                ero[cur][c - 'a'][i] + 1);
        flag++;
        k -= cnt;
        break;
      }
      k -= temp;
    }
    cur = !cur;
    last = !last;
  }
  return 0;
}
