#include <bits/stdc++.h>
using namespace std;
const int N = 400100;
namespace string_tool {
struct SAM_node {
  SAM_node *pre, *next[26];
  int next2_sum;
  int endpos;
  int vis;
  int step;
  unsigned long long child;
  long max_long;
  long cur_long;
  int _time;
  int sum;
  int cnt3;
  unsigned long long cnt;
  unsigned long long ans;
  int firstpos;
  void clear() {
    endpos = 0;
    vis = 0;
    ans = 0;
    sum = 0;
    cnt = 0;
    cnt3 = 0;
    child = 0;
    next2_sum = 0;
    pre = 0;
    step = 0;
    cur_long = -1;
    max_long = 101000;
    _time = 0;
    firstpos = 0;
    memset(next, 0, sizeof(next));
  }
};
long d[N * 2];
SAM_node *pool[N * 2];
SAM_node SAM_Pool[N * 2];
int part2[26];
struct SAM {
  SAM_node *root, *last;
  SAM_node *cur;
  long tot;
  long tot2;
  long k;
  long length;
  void init() {
    cur = SAM_Pool;
    root = last = cur++;
    root->clear();
    tot = 0;
    length = 0;
  }
  void Insert(int w) {
    length++;
    SAM_node *p = last;
    SAM_node *np = cur++;
    np->clear();
    np->step = p->step + 1;
    np->firstpos = np->step - 1;
    while (p && !p->next[w]) {
      p->next[w] = np, p = p->pre;
    }
    if (p == 0)
      np->pre = root;
    else {
      SAM_node *q = p->next[w];
      if (p->step + 1 == q->step)
        np->pre = q;
      else {
        SAM_node *nq = cur++;
        nq->clear();
        memcpy(nq->next, q->next, sizeof(q->next));
        nq->firstpos = q->firstpos;
        nq->cnt = q->cnt;
        nq->step = p->step + 1;
        nq->pre = q->pre;
        q->pre = nq;
        np->pre = nq;
        while (p && p->next[w] == q) {
          p->next[w] = nq, p = p->pre;
        }
      }
    }
    tot += (np->step - np->pre->step);
    last = np;
  }
  void build(string &s) {
    tot2 = 0;
    init();
    for (int i = 0; i < s.size(); ++i) Insert(s[i] - 'a');
  }
  string LCS(string &b) {
    int lenmax = 0, len2 = 0, sign = 0;
    SAM_node *find_point = root;
    string interim;
    for (long i = 0; i < b.size(); ++i) {
      if (find_point->next[b[i] - 'a'] != NULL) {
        len2++;
        find_point = find_point = find_point->next[b[i] - 'a'];
      } else {
        while (find_point->next[b[i] - 'a'] == NULL && find_point != root)
          find_point = find_point->pre;
        if (find_point->next[b[i] - 'a'] == NULL)
          len2 = 0;
        else {
          len2 = find_point->step + 1;
          find_point = find_point->next[b[i] - 'a'];
        }
      }
      if (len2 > lenmax) {
        sign = i - len2;
        lenmax = len2;
      }
    }
    interim = b.substr(sign + 1, lenmax);
    return interim;
  }
  void clear_count(SAM_node *count) {
    if (count->child == -1 || count == last)
      return;
    else {
      count->child = -1;
      for (int i = 0; i < 26; ++i)
        if (count->next[i] != NULL) clear_count(count->next[i]);
    }
  }
  long count_substring(SAM_node *count) {
    if (count == last) {
      count->child = 1;
      return 1;
    }
    if (count->child > 0) return count->child;
    count->child = 1;
    for (int i = 0; i < 26; ++i)
      if (count->next[i] != NULL)
        count->child += count_substring(count->next[i]);
    return count->child;
  }
  long count_substring3(SAM_node *count) {
    if (count == last) {
      count->child = 1;
      return 1;
    }
    if (count->child > 0) return count->child;
    count->child = count->cnt;
    for (int i = 0; i < 26; ++i)
      if (count->next[i] != NULL)
        count->child += count_substring3(count->next[i]);
    return count->child;
  }
  unsigned long long count_substring2(SAM_node *count) {
    if (count->ans > 0) return count->ans;
    unsigned long long ans = 1;
    for (int i = 0; i < 26; ++i)
      if (count->next[i] != NULL)
        ans += count_substring2(count->next[i]);
      else {
        if (part2[i] != 0) ans += part2[i];
      }
    count->ans = ans;
    return ans;
  }
  long LCS_2(vector<string> &part) {
    topo();
    for (int i = 0; i < part.size(); ++i) {
      SAM_node *find_point = root;
      long len = 0;
      for (int j = 0; j < part[i].size(); ++j) {
        if (find_point->next[part[i][j] - 'a'] != NULL) {
          len++;
          find_point = find_point = find_point->next[part[i][j] - 'a'];
        } else {
          while (find_point->next[part[i][j] - 'a'] == NULL &&
                 find_point != root)
            find_point = find_point->pre;
          if (find_point->next[part[i][j] - 'a'] == NULL)
            len = 0;
          else {
            len = find_point->step + 1;
            find_point = find_point->next[part[i][j] - 'a'];
          }
        }
        if (len > find_point->cur_long) find_point->cur_long = len;
      }
      int cnt = cur - SAM_Pool;
      for (int i = cnt - 1; i >= 1; i--)
        if (pool[i]->cur_long >= 0 && pool[i]->pre != root)
          if (pool[i]->cur_long > pool[i]->pre->step)
            pool[i]->pre->cur_long = pool[i]->pre->step;
          else
            pool[i]->pre->cur_long = pool[i]->cur_long;
      SAM_node *part3 = SAM_Pool;
      while (part3 != cur) {
        if (part3->cur_long > 0) {
          part3->max_long = min(part3->cur_long, part3->max_long);
          part3->_time++;
          part3->cur_long = -1;
        }
        part3++;
      }
    }
    SAM_node *part3 = SAM_Pool;
    long ans = 0;
    while (part3 != cur) {
      if (part3->max_long != 1001000 && part3->_time == part.size())
        ans = max(ans, part3->max_long);
      part3++;
    }
    return ans;
  }
  void count_k_pre(string &s) {
    topo();
    int cnt = cur - SAM_Pool;
    SAM_node *p = SAM_Pool;
    for (int i = 0; i < length; ++i) {
      p = p->next[s[i] - 'a'];
      p->cnt = 1;
    }
    for (int i = cnt - 1; i >= 1; i--) pool[i]->pre->cnt += pool[i]->cnt;
  }
  long count_k(long k) {
    SAM_node *part = SAM_Pool;
    long sum = 0;
    while (part != cur) {
      if (part != root && part->cnt >= k) {
        sum += (part->step - part->pre->step);
      }
      part++;
    }
    return sum;
  }
  void topo() {
    int cnt = cur - SAM_Pool;
    int maxVal = 0;
    memset(d, 0, sizeof(d));
    for (int i = 1; i < cnt; i++)
      maxVal = max(maxVal, SAM_Pool[i].step), d[SAM_Pool[i].step]++;
    for (int i = 1; i <= maxVal; i++) d[i] += d[i - 1];
    for (int i = 1; i < cnt; i++) pool[d[SAM_Pool[i].step]--] = &SAM_Pool[i];
    pool[0] = root;
  }
  long mod_str(long mod) {
    long sum = 0;
    topo();
    pool[0]->cnt3 = 1;
    int cnt = cur - SAM_Pool;
    for (int i = 0; i < cnt; ++i) {
      pool[i]->sum = pool[i]->sum % 2012;
      if (i == 0) {
        for (int j = 1; j < 10; ++j)
          if (pool[i]->next[j] != NULL) {
            pool[i]->next[j]->cnt3 += pool[i]->cnt3;
            pool[i]->next[j]->sum += pool[i]->sum * 10 + pool[i]->cnt3 * j;
          }
      } else {
        for (int j = 0; j < 10; ++j)
          if (pool[i]->next[j] != NULL) {
            pool[i]->next[j]->cnt3 += pool[i]->cnt3;
            pool[i]->next[j]->sum += pool[i]->sum * 10 + pool[i]->cnt3 * j;
          }
      }
    }
    for (int i = 0; i < cnt; ++i) sum += pool[i]->sum;
    return sum;
  }
  void print_kth(int k, SAM_node *part) {
    if (k != 0) {
      for (int i = 0; i < 26; ++i) {
        if (part->next[i] != NULL)
          if (part->next[i]->child < k) {
            k -= part->next[i]->child;
          } else {
            k--;
            cout << char('a' + i);
            print_kth(k, part->next[i]);
            break;
          }
      }
    }
  }
  void print_kth2(int k, SAM_node *part) {
    if (k != 0) {
      for (int i = 0; i < 26; ++i) {
        if (part->next[i] != NULL) {
          if (part->next[i]->child < k) {
            k -= part->next[i]->child;
          } else {
            cout << char('a' + i);
            k = max((unsigned long long)(0), k - part->next[i]->cnt);
            print_kth2(k, part->next[i]);
            break;
          }
        }
      }
    }
  }
};
}  // namespace string_tool
using namespace string_tool;
int main() {
  ios::sync_with_stdio(false);
  unsigned long long a;
  string b;
  SAM c;
  cin >> b >> a;
  c.build(b);
  c.count_k_pre(b);
  c.count_substring3(c.root);
  if ((c.root->child + c.root->cnt) > a) {
    c.print_kth2(a, c.root);
    cout << endl;
  } else
    cout << "No such line." << endl;
  return 0;
}
