#include <bits/stdc++.h>
using namespace std;
long long add(long long a, long long b, long long n) {
  a += b;
  if (a >= n) a -= n;
  return a;
}
long long sub(long long a, long long b, long long n) {
  a -= b;
  if (a < 0) a += n;
  return a;
}
struct Fenwick {
  long long n;
  vector<long long> t;
  Fenwick(long long n) : n(n) { t.resize(n); }
  void add2(long long r, long long ad) {
    for (long long i = r; i < n; i |= (i + 1)) t[i] += ad;
  }
  void add(long long l, long long r) {
    add2(l, 1);
    add2(r + 1, -1);
  }
  long long get(long long r) {
    long long res = 0;
    for (long long i = r; i >= 0; i = (i & (i + 1)) - 1) res += t[i];
    return res;
  }
};
struct SparseTable {
  long long n;
  vector<vector<long long>> st;
  vector<long long> lg;
  SparseTable(vector<long long> a) {
    long long n = a.size(), log = 1;
    while ((1 << log) < n) log++;
    log++;
    st.resize(log, vector<long long>(n));
    for (long long i = 0; i < n; ++i) st[0][i] = a[i];
    for (long long j = 1; j < log; ++j) {
      for (long long i = 0; i + (1 << (j - 1)) < n; ++i) {
        long long v1 = st[j - 1][i];
        long long v2 = st[j - 1][i + (1 << (j - 1))];
        st[j][i] = min(v1, v2);
      }
    }
    lg.resize(n + 1);
    for (long long i = 2; i <= n; ++i) lg[i] = lg[i / 2] + 1;
  }
  long long get(long long l, long long r) {
    long long p = lg[r - l + 1];
    long long v1 = st[p][l], v2 = st[p][r - (1 << p) + 1];
    return min(v1, v2);
  }
};
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(nullptr);
  string s;
  cin >> s;
  long long need;
  cin >> need;
  long long n = s.size();
  vector<long long> a;
  for (auto& x : s) a.push_back(x - 'a' + 1);
  a.push_back(0);
  n++;
  vector<long long> p(n), c(n), start(max(n, 27ll)), cnt(max(n, 27ll));
  for (auto& x : a) {
    cnt[x]++;
  }
  for (long long i = 1; i < start.size(); ++i) {
    start[i] = start[i - 1] + cnt[i - 1];
  }
  for (long long i = 0; i < n; ++i) {
    p[start[a[i]]++] = i;
  }
  long long ce = 0;
  for (long long i = 1; i < n; ++i) {
    if (a[p[i]] != a[p[i - 1]]) ce++;
    c[p[i]] = ce;
  }
  for (long long len = 1; len < n; len <<= 1) {
    for (auto& x : cnt) x = 0;
    for (long long i = 0; i < n; ++i) {
      p[i] = sub(p[i], len, n);
      cnt[c[p[i]]]++;
    }
    start[0] = 0;
    for (long long i = 1; i < n; ++i) {
      start[i] = start[i - 1] + cnt[i - 1];
    }
    vector<long long> np(n), nc(n);
    for (long long i = 0; i < n; ++i) {
      np[start[c[p[i]]]++] = p[i];
    }
    long long ce = 0;
    for (long long i = 1; i < n; ++i) {
      if (make_pair(c[np[i]], c[add(np[i], len, n)]) !=
          make_pair(c[np[i - 1]], c[add(np[i - 1], len, n)])) {
        ce++;
      }
      nc[np[i]] = ce;
    }
    p = np, c = nc;
  }
  vector<long long> lcp(n), pos(n);
  for (long long i = 0; i < n; ++i) {
    pos[p[i]] = i;
  }
  long long k = 0;
  for (long long i = 0; i < n - 1; ++i) {
    while (i + k < n and p[pos[i] - 1] + k < n and
           s[i + k] == s[p[pos[i] - 1] + k]) {
      k++;
    }
    lcp[pos[i]] = k;
    k = max(0ll, k - 1);
  }
  if (need > n * (n - 1) / 2) {
    cout << "No such line.\n";
  } else {
    SparseTable ST(lcp);
    Fenwick tree(n + 1);
    long long cur = 0;
    for (long long i = 1; i < n; ++i) {
      long long cc = tree.get(i);
      for (long long j = p[i] + tree.get(i); j < n - 1; ++j) {
        cc++;
        long long l = i, r = n;
        while (l + 1 < r) {
          long long m = (l + r) / 2;
          if (ST.get(i + 1, m) >= cc)
            l = m;
          else
            r = m;
        }
        if (l - i + 1 + cur >= need) {
          for (long long f = p[i]; f <= j; ++f) cout << s[f];
          return 0;
        }
        cur += l - i + 1;
        tree.add(i, l);
      }
    }
  }
}
