func_code_string: #include <bits/stdc++.h>   using namespace std;   string inc[6] = { 011112 ,  103231 ,  110121 ,  121011 ,  ,112101 ,  211110 };   string near[6] = { 1234 ,  0254 ,  0153 ,  4520 ,  3510 ,  4321 };   int opp[6] = {5, 3, 4, 1, 2, 0};   char t[7], s[7];   string t_p;   bool seen[6];   set<string> se;   void dfs(int x, int v) {     seen[x] = true;     t[v] = s[x];     if (v == 5) {       t_p = min((string)t, t_p);     } else {       for (int i = 0; i < 6; i++) {         if (inc[x][i] ==  1  && !seen[i]) {           dfs(i, v + 1);         }       }     }     seen[x] = false;   }   int X[4] = {1, 2, 3, 4}, Y[4] = {0, 1, 5, 3}, Z[4] = {0, 2, 5, 4};   void cycle(int* r) {     int x = t[r[0]];     t[r[0]] = t[r[1]];     t[r[1]] = t[r[2]];     t[r[2]] = t[r[3]];     t[r[3]] = x;   }   int main() {     t[6] =   0 ;     while (cin >> s) {       se.clear();       sort(s, s + 6);       do {         for (int i = 0; i < 6; i++) t[i] = s[i];         t_p =  ZZZZZZ ;         for (int i = 0; i < 4; i++) {           for (int j = 0; j < 4; j++) {             for (int k = 0; k < 4; k++) {               t_p = min((string)t, t_p);               cycle(X);             }             cycle(Y);           }           cycle(Z);         }         se.insert(t_p);       } while (next_permutation(s, s + 6));       cout << se.size() << endl;     }   }   