func_code_string: #include <bits/stdc++.h>   #pragma GCC optimize(2)   using namespace std;   const int mod = 1e9 + 7;   const double eps = 1e-6;   const int N = 1e6 + 7;   int tr[N][26], id[N], idx;   char s[100007][1003], str[10007];   bool flag;   int n, m, len[N];   int res[N], cnt;   int trans(char c) {     if (c >=  A  && c <=  Z ) c = c -  A  +  a ;     return c;   }   void insert(int first) {     int p = 0;     for (int i = len[first] - 1; i >= 0; i--) {       int t = trans(s[first][i]) -  a ;       if (!tr[p][t]) tr[p][t] = ++idx;       p = tr[p][t];     }     id[p] = first;   }   void dfs(int first) {     if (flag) return;     if (first == n) {       for (int i = 0; i < cnt; i++) cout << s[res[i]] <<    ;       puts(  );       flag = true;       return;     }     int p = 0;     for (int i = first; i < n; i++) {       int t = str[i] -  a ;       if (!tr[p][t]) break;       p = tr[p][t];       if (id[p] != -1) {         res[cnt++] = id[p];         dfs(first + len[id[p]]);         cnt--;       }     }   }   int main() {     ios::sync_with_stdio(false);     memset(id, -1, sizeof(id));     cin >> n >> str >> m;     for (int i = 0; i <= m - 1; i++) {       cin >> s[i];       len[i] = strlen(s[i]);       insert(i);     }     dfs(0);     return 0;   }   