#include <bits/stdc++.h>
using namespace std;
int INF = 2e9;
vector<int> pref(string& s) {
  int n = s.size();
  vector<int> g(n, 0);
  for (int i = 1; i < n; i++) {
    int j = g[i - 1];
    while (j > 0 and s[i] != s[j]) {
      j = g[j - 1];
    }
    if (s[i] == s[j]) j++;
    g[i] = j;
  }
  return g;
}
int N = 3e5 + 10;
vector<long long> tree;
void build(vector<int>& g, int v, int tl, int tr) {
  if (tl == tr)
    tree[v] = g[tl];
  else {
    int tm = (tl + tr) / 2;
    build(g, 2 * v, tl, tm);
    build(g, 2 * v + 1, tm + 1, tr);
    tree[v] = max(tree[2 * v], tree[2 * v + 1]);
  }
}
int find_max(int v, int tl, int tr, int l, int r) {
  if (l > r) return 0;
  if (tl == l and tr == r) return tree[v];
  int tm = (tl + tr) / 2;
  return max(find_max(2 * v, tl, tm, l, min(tm, r)),
             find_max(2 * v + 1, tm + 1, tr, max(tm + 1, l), r));
}
void update(long long v, long long tl, long long tr, long long pos,
            long long val) {
  if (tl == tr)
    tree[v] = val;
  else {
    long long tm = (tl + tr) / 2;
    if (pos <= tm)
      update(2 * v, tl, tm, pos, val);
    else
      update(2 * v + 1, tm + 1, tr, pos, val);
    tree[v] = max(tree[2 * v], tree[2 * v + 1]);
  }
}
long long bin_pow(long long a, long long b, long long m) {
  if (b == 0) return 1;
  a %= m;
  if (b % 2 == 0) {
    return bin_pow(a * a, b / 2, m) % m;
  } else
    return (a * bin_pow(a, b - 1, m)) % m;
}
unsigned long long numbers(unsigned long long n) {
  unsigned long long a = 0;
  while (n != 0) {
    n /= 10;
    a++;
  }
  return a;
}
unsigned long long num(unsigned long long j, unsigned long long n1,
                       unsigned long long k) {
  unsigned long long t = 0, a = 0;
  while (a != n1 - k + 1) {
    t = j % 10;
    j /= 10;
    a++;
  }
  return t;
}
char f(string s) {
  if (s[0] == 'a' and s[1] == 'b' or s[1] == 'a' and s[0] == 'b') return 'c';
  if (s[0] == 'a' and s[1] == 'c' or s[1] == 'a' and s[0] == 'c') return 'b';
  if (s[0] == 'b' and s[1] == 'c' or s[1] == 'b' and s[0] == 'c') return 'a';
}
vector<int> ssize;
vector<int> parent;
int find_set(int v) {
  if (v == parent[v]) {
    return v;
  }
  return parent[v] = find_set(parent[v]);
}
void union_set(int a, int b) {
  a = find_set(a);
  b = find_set(b);
  if (a != b) {
    if (ssize[a] < ssize[b]) {
      parent[a] = b;
      ssize[b] += ssize[a];
    } else {
      parent[b] = a;
      ssize[a] += ssize[b];
    }
  }
}
void f(int v, int l, int r, int pos) {
  if (l == r)
    tree[v] = 1;
  else {
    int m = (l + r) / 2;
    if (m >= pos) {
      f(2 * v + 1, l, m, pos);
    } else {
      f(2 * v + 2, m + 1, r, pos);
    }
    tree[v] = tree[2 * v + 1] + tree[2 * v + 2];
  }
}
int F(int v, int l, int r, int sum) {
  if (l == r) {
    return l;
  }
  int m = (l + r) / 2;
  if (tree[2 * v + 1] < sum) {
    return F(2 * v + 2, m + 1, r, sum - tree[2 * v + 1]);
  } else {
    return F(2 * v + 1, l, m, sum);
  }
}
struct wor {
  long long a, b, c, d, e;
};
bool cmp(wor w1, wor w2) { return w1.a > w2.a; }
bool cmp1(wor w1, wor w2) { return w1.b < w2.b; }
bool cmp2(wor w1, wor w2) { return w1.c < w2.c; }
double C_n_k(int n, int k) {
  k = max(n - k, k);
  double ans = 1;
  int pow_two = n + 1;
  for (int i = k + 1; i <= n; i++) {
    ans *= i;
    while (ans > 1e5 and pow_two != 0) {
      ans /= 2;
      pow_two--;
    }
  }
  for (int i = 1; i <= n - k; i++) {
    ans /= i;
  }
  while (pow_two != 0) {
    ans /= 2;
    pow_two--;
  }
  return ans;
}
vector<vector<int>> up;
int l, timer;
void dfs_lca(int v, int p, vector<vector<int>>& g, vector<int>& tinn,
             vector<int>& toutt) {
  tinn[v] = timer;
  timer++;
  up[v][0] = p;
  for (int i = 1; i <= l; i++) {
    up[v][i] = up[up[v][i - 1]][i - 1];
  }
  for (int i = 0; i < g[v].size(); i++) {
    int to = g[v][i];
    if (to == p) continue;
    dfs_lca(to, v, g, tinn, toutt);
  }
  toutt[v] = timer;
}
bool upper(int a, int b, vector<int>& tinn, vector<int>& toutt) {
  if (tinn[a] <= tinn[b] and toutt[a] >= toutt[b]) {
    return true;
  }
  return false;
}
long long lca(int a, int b, vector<int>& tinn, vector<int>& toutt) {
  long long ans = 0;
  if (upper(a, b, tinn, toutt)) return 0;
  for (int i = l; i >= 0; i--) {
    if (!upper(up[a][i], b, tinn, toutt)) {
      a = up[a][i];
      ans += (1 << i);
    }
  }
  ans += 1;
  return ans;
}
long long phi(long long n) {
  long long ans = n;
  for (long long i = 2; i * i <= n; i++) {
    if (n % i == 0) {
      while (n % i == 0) {
        n /= i;
      }
      ans -= ans / i;
    }
  }
  if (n != 1) {
    ans -= ans / n;
  }
  return ans;
}
int main() {
  ios_base ::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  string s;
  cin >> s;
  long long n = s.size();
  s += '.';
  long long k;
  cin >> k;
  vector<int> g(30, 0);
  if (n * (n + 1) / 2 < k) {
    cout << "No such line.";
    return 0;
  }
  for (int i = 0; i < n; i++) {
    g[s[i] - 'a']++;
  }
  string ans = "";
  vector<long long> sum1;
  vector<long long> sum2;
  for (int i = 0; i < n; i++) {
    sum1.push_back(i);
  }
  while (k != 0) {
    for (int i = 0; i < 30; i++) {
      if (g[i]) {
        long long sum = 0;
        for (int j = 0; j < sum1.size(); j++) {
          if (s[sum1[j]] - 'a' == i) {
            sum += n - sum1[j];
          }
        }
        if (k > sum) {
          k -= sum;
        } else {
          ans.push_back((char)(i + 'a'));
          for (int j = 0; j < sum1.size(); j++) {
            if (s[sum1[j]] - 'a' == i) {
              sum2.push_back(sum1[j] + 1);
            }
          }
          if (sum2.size() >= k) {
            cout << ans;
            return 0;
          }
          k -= sum2.size();
          break;
        }
      }
    }
    sum1 = sum2;
    sum2.clear();
  }
  return 0;
}
