func_code_string: #include <bits/stdc++.h>   using namespace std;   int n;   int num = 0;   int cnt[1000] = {0};   int candidate[400005] = {0};   string s;   bool check(int added) {     if (added % 2) return false;     if (n % (added + num)) return false;     if ((n / (added + num)) % 2 == 0) return false;     return true;   }   int main() {     cin >> n >> s;     for (int i = 0; i < n; ++i) cnt[s[i]]++;     for (int i = 0; i < 200; ++i) {       if (cnt[i] % 2) {         cnt[i] -= 1;         candidate[num++] = i;       }     }     if (num == 0) {       string before =   ;       string after =   ;       for (int j = 40; j < 130; ++j) {         while (cnt[j] >= 2) {           cnt[j] -= 2;           before += j;           after += j;         }       }       cout << 1 << endl;       reverse(before.begin(), before.end());       cout << before + after << endl;       return 0;     }     int added = 0;     while (!check(added)) ++added;     for (int i = 40; i < 130; ++i) {       if (!added) break;       if (cnt[i] > added) {         for (int j = 0; j < added; ++j) candidate[num++] = i;         cnt[i] -= added;         added = 0;       } else {         for (int j = 0; j < cnt[i]; ++j) candidate[num++] = i;         added -= cnt[i];         cnt[i] = 0;       }     }     cout << num << endl;     for (int i = 0; i < num; ++i) {       string before =   ;       string after =   ;       after += char(candidate[i]);       int remain = (n / num) - 1;       for (int j = 40; j < 130; ++j) {         if (!remain) break;         if (cnt[j] >= remain) {           for (int k = 0; k < remain / 2; ++k) {             before += char(j);             after += char(j);           }           cnt[j] -= remain;           remain = 0;         } else {           for (int k = 0; k < cnt[j] / 2; ++k) {             before += char(j);             after += char(j);           }           remain -= cnt[j];           cnt[j] = 0;         }       }       reverse(before.begin(), before.end());       cout << before + after <<    ;     }     return 0;   }   