func_code_string: #include <bits/stdc++.h>   using namespace std;   const int N = 1e5 + 10, mod = 1e9 + 7;   int k, n, sz, last;   char s[N];   string ret;   long long cnt[2 * N], dp[2 * N];   char inp[N];   struct state {     int link, len, next[26];   };   state st[2 * N];   bool vis[2 * N];   void sa_init() {     st[0].len = 0;     st[0].link = -1;     for (int i = 0; i < 26; i++) st[0].next[i] = -1;     sz = 1;     last = 0;   }   void sa_extend(char ch) {     int cur = sz++;     int c = ch -  a ;     st[cur].len = st[last].len + 1;     for (int i = 0; i < 26; i++) st[cur].next[i] = -1;     int p = last;     while (p != -1 && st[p].next[c] == -1) {       st[p].next[c] = cur;       p = st[p].link;     }     if (p == -1)       st[cur].link = 0;     else {       int q = st[p].next[c];       if (st[q].len == st[p].len + 1)         st[cur].link = q;       else {         int clone = sz++;         for (int i = 0; i < 26; i++) st[clone].next[i] = -1;         st[clone] = st[q];         st[clone].len = st[p].len + 1;         while (p != -1 && st[p].next[c] == q) {           st[p].next[c] = clone;           p = st[p].link;         }         st[cur].link = st[q].link = clone;       }     }     last = cur;     cnt[cur] = 1;   }   bool cmp(int x, int y) { return st[x].len > st[y].len; }   void dfs(int u) {     vis[u] = 1;     dp[u] = cnt[u];     for (int j = 0; j < 26; j++) {       int v = st[u].next[j];       if (v == -1) continue;       if (!vis[v]) dfs(v);       dp[u] += dp[v];     }   }   void solve(int u) {     for (int j = 0; j < 26; j++) {       int v = st[u].next[j];       if (v == -1) continue;       if (dp[v] >= k) {         k -= cnt[v];         ret.push_back(j +  a );         if (k > 0)           solve(v);         else           k = 0;         break;       }       k -= dp[v];     }   }   int main() {     scanf( %s%d , &s, &k);     n = strlen(s);     sa_init();     for (int i = 0; i < n; i++) sa_extend(s[i]);     vector<int> v(sz);     iota(v.begin(), v.end(), 0);     sort(v.begin(), v.end(), cmp);     for (int i = 0; i < sz; i++) {       cnt[st[v[i]].link] += cnt[v[i]];     }     dfs(0);     solve(0);     if (!k)       cout << ret <<   n ;     else       cout <<  No such line. n ;     return 0;   }   