func_code_string: #include <bits/stdc++.h>   using namespace std;   long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }   const int MAXN = 100;   const int MAXLEN = 26;   bool done[26];   bool have[26];   bool before[26][26];   char nxt[26];   int n;   char s[MAXLEN + 1];   void run() {     memset(done, false, sizeof(done));     memset(have, false, sizeof(have));     memset(before, false, sizeof(before));     memset(nxt,  ? , sizeof(nxt));     scanf( %d , &n);     for (int i = (0); i < (n); ++i) {       scanf( %s , s);       int slen = strlen(s);       for (int j = (0); j < (slen); ++j) have[s[j] -  a ] = true;       for (int j = (0); j < (slen); ++j)         for (int k = (j + 1); k < (slen); ++k)           before[s[j] -  a ][s[k] -  a ] = true;       for (int j = (0); j < (slen - 1); ++j) nxt[s[j] -  a ] = s[j + 1];     }     for (int k = (0); k < (26); ++k)       for (int i = (0); i < (26); ++i)         for (int j = (0); j < (26); ++j)           if (before[i][k] && before[k][j]) before[i][j] = true;     while (true) {       int idx = -1;       for (int i = (0); i < (26); ++i)         if (!done[i] && have[i]) {           bool ok = true;           for (int j = (0); j < (26); ++j)             if (!done[j] && have[j] && before[j][i]) ok = false;           if (ok) {             idx = i;             break;           }         }       if (idx == -1) {         puts(  );         break;       }       while (true) {         printf( %c ,  a  + idx);         done[idx] = true;         if (nxt[idx] ==  ? )           break;         else           idx = nxt[idx] -  a ;       }     }   }   int main() {     run();     return 0;   }   