#include<bits/stdc++.h>
using namespace std;

#define double long double
#define int long long
#define vec vector
#define pb push_back
#define unset unordered_set
#define ii pair<int, int>
#define X first
#define Y second
#define FOR(i, a, b) for(int i = (a); i < (b); i++)
#define FORE(i, a, b) for(int i = (a); i <= (b); i++)
#define FORD(i, a, b) for(int i = (a); i >= (b); i--)
#define bitcount(n) __builtin_popcountll(n)
template <typename T,typename U>
std::pair<T,U> operator+(const std::pair<T,U> & l,const std::pair<T,U> & r) {
  return {l.first+r.first,l.second+r.second};
}
typedef void (*callback_function)(void); // type for conciseness
const long long ZERO = 0LL;
const long long INF64 = 1e18;
const int INF32 = 1e9;
const int MOD = 1e9 + 7;
const double PI = acos(-1.0L);
const double EPS = static_cast<double>(1e-9);
typedef long long ll;

inline int Pow(int a, int k) {
  int s = 1;
  for(; k; k >>= 1) {
    k & 1 ? s = 1LL * s * a % MOD : 0;
    a = 1LL * a * a % MOD;
  }
  return s;
}

// Init variables here
const int N = 1e6 + 7;

void input() {
  //freopen("??.in", "r", stdin);
  //freopen("??.out", "w", stdout);
}

void output() {

}

void preprocess() {

}

void debug() {
  if (true) {

  }
}

int cnt[256];

void solve() {
  preprocess();
  int n; string s;
  cin >> n >> s;
  for (char &ch : s) {
    cnt[(int)ch]++;
  }
  vec<string> odd, even;
  FORE(i, 'a', 'z') {
    if (cnt[i] % 2) {odd.push_back(string(cnt[i], (char)i));}
    else if (cnt[i]) {even.push_back(string(cnt[i] / 2, (char)i));}
  }
  FORE(i, 'A', 'Z') {
    if (cnt[i] % 2) {odd.push_back(string(cnt[i], (char)i));}
    else if (cnt[i]) {even.push_back(string(cnt[i] / 2, (char)i));}
  }
  FORE(i, '0', '9') {
    if (cnt[i] % 2) {odd.push_back(string(cnt[i], (char)i));}
    else if (cnt[i]) {even.push_back(string(cnt[i] / 2, (char)i));}
  }
  cout << max(1LL, (int)odd.size()) << endl;;
  string res;
  if (odd.size()) {res = odd.back(); odd.pop_back();}
  for (string &t : even) {res = t + res + t;}
  cout << res;
  for (string &t : odd) {cout << ' ' << t;}
  cout << endl;
  //debug();
  // read the question correctly (is y a vowel?)
  // look out for SPECIAL CASES (n=1?) and overflow (ll vs int?)
}

#undef int
int main() {
#define int long long
	ios_base::sync_with_stdio(false);
	cin.tie();
  //auto beginProgram = chrono::steady_clock::now();

  //int t; cin >> t;
  //while (t--)
  {
    input();
    solve();
    output();
  }

  //auto endProgram = chrono::steady_clock::now();

  return 0;
}


#include<bits/stdc++.h>
using namespace std;

#define vec vector
#define pb push_back
#define FOR(i, a, b) for(int i = (a); i < (b); i++)
#define FORE(i, a, b) for(int i = (a); i <= (b); i++)
#define FORD(i, a, b) for(int i = (a); i >= (b); i--)

const int N = 1e6;
int n;
char s[N];
int cnt[256];
vec<char> odd;
vec<char> even;

void pairing(char start, char end) {
  FORE(i, start, end) {
    if (cnt[i] % 2) {odd.push_back((char)i);}
    FORD(j, cnt[i] / 2, 1) {even.push_back((char)i);}
  }
}

void solve() {
  //cin >> n >> s;
  scanf("%d %s", &n, s);
  FOR(i, 0, n) {cnt[(int)s[i]]++;}
  pairing('a', 'z'), pairing('A', 'Z'), pairing('0', '9');
  if (odd.empty()) {
    //cout << 1 << endl;
    printf("1\n");
    string res = "";
    for (char &ch : even) {res = ch + res + ch;}
    //cout << res << endl;
    printf("%s\n", res.c_str());
    return;
  }
  while (even.size() % odd.size()) {
    char ch = even.back(); even.pop_back();
    odd.push_back(ch); odd.push_back(ch);
  }
  //cout << odd.size() << endl;
  printf("%d\n", (int)odd.size());
  int m = even.size() / odd.size();
  int id = 0;
  for (char &ch : odd) {
    //string t = "";
    //t += ch;
    FOR(i, 0, m) {
      //char c = even[id++];
      //t = c + t + c;
      putchar(even[id++]);
    }
    putchar(ch);
    FOR(i, 0, m) {
      putchar(even[--id]);
    }
    putchar(' ');
    id += m;
    //cout << t << ' ';
    //printf("%s ", t.c_str());
  }
  //cout << endl;
  printf("\n");
  // read the question correctly (is y a vowel?)
  // look out for SPECIAL CASES (n=1?) and overflow (ll vs int?)
}

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie();
  //auto beginProgram = chrono::steady_clock::now();

  //int t; cin >> t;
  //while (t--)
  {
    solve();
  }

  //auto endProgram = chrono::steady_clock::now();

  return 0;
}


#include<bits/stdc++.h>
using namespace std;

#define vec vector
#define pb push_back
#define FOR(i, a, b) for(int i = (a); i < (b); i++)
#define FORE(i, a, b) for(int i = (a); i <= (b); i++)
#define FORD(i, a, b) for(int i = (a); i >= (b); i--)

const int N = 1e6;
int n;
char s[N];
int cnt[256];
vec<char> odd;
vec<char> even;

void pairing(char start, char end) {
  FORE(i, start, end) {
    if (cnt[i] % 2) {odd.push_back((char)i);}
    FORD(j, cnt[i] / 2, 1) {even.push_back((char)i);}
  }
}

// Since there are upto 4 * 10^5 characters to print, try to print them
// or add them to strings in order. It's tempting to add to strings from
// both directions when building palindromes but this will create a lot of new
// strings and take up a lot of time.

void solve() {
  //scanf("%d %s", &n, s);
  cin >> n >> s;
  FOR(i, 0, n) {cnt[(int)s[i]]++;}
  pairing('a', 'z'), pairing('A', 'Z'), pairing('0', '9');
  if (odd.empty()) {
    //puts("1");
    cout << "1\n";
    int m = even.size();
    FOR(i, 0, m) {
      //putchar(even[i]);
      cout << even[i];
    }
    FORD(i, m - 1, 0) {
      //putchar(even[i]);
      cout << even[i];
    }
    return;
  }
  while (even.size() % odd.size()) {
    char ch = even.back(); even.pop_back();
    odd.push_back(ch); odd.push_back(ch);
  }
  //printf("%d\n", (int)odd.size());
  cout << odd.size() << endl;
  int m = even.size() / odd.size();
  int id = 0;
  for (char &ch : odd) {
    FOR(i, 0, m) {
      //putchar(even[id++]);
      cout << even[id++];
    }
    //putchar(ch);
    cout << ch;
    FOR(i, 0, m) {
      //putchar(even[--id]);
      cout << even[--id];
    }
    //putchar(' ');
    cout << ' ';
    id += m;
  }
  // read the question correctly (is y a vowel?)
  // look out for SPECIAL CASES (n=1?) and overflow (ll vs int?)
}

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie();
  //auto beginProgram = chrono::steady_clock::now();

  //int t; cin >> t;
  //while (t--)
  {
    solve();
  }

  //auto endProgram = chrono::steady_clock::now();

  return 0;
}


#include<bits/stdc++.h>
#define IOS ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define pb emplace_back
#define mp make_pair
#define all(v) v.begin(),v.end()
#define sz(x) (ll)x.size()
#define F first
#define S second
#define FOR(i,a,b) for(ll i=a;i<=b;++i)
#define ROF(i,a,b) for(ll i=a;i>=b;--i)
typedef long long ll;
using namespace std;

map<char,int>f;

int main(){
    IOS

    int n;
    cin >> n;
    string s;
    cin >> s;
    FOR(i,0,n-1){
        f[s[i]]++;
    }
    int cnt = 0;
    vector<char> odd, even;
    for(char i = '0'; i <= 'z' ; i ++){
        if(f[i] == 0)
            continue;
        if(f[i] % 2 == 1){
            odd.pb(i);
            f[i]--;
        }
        while(f[i]){
            even.pb(i);
            f[i] -= 2;
        }
    }
    char ans[n+1];
    if(odd.empty()){
        cout << 1 << endl;
        for(int i = 0; i < n / 2; i++){
            ans[i] = ans[n-i-1] = even[i];
        }
        ans[n] = '\0';
        cout << ans;
        return 0;
    }
    while(sz(even) % sz(odd) > 0){
        odd.pb(even.back());
        odd.pb(even.back());
        even.pop_back();
    }
    cout << sz(odd) << endl;
    int len = n / sz(odd);
    while(!odd.empty()){
        ans[len/2] = odd.back();
        odd.pop_back();
        for(int j = 0; j < len / 2; j++){
            ans[j] = ans[len - j - 1] = even.back();
            even.pop_back();
        }
        ans[len] = '\0';
        cout << ans << " ";
    }

    return 0;
}


#include<bits/stdc++.h>
#define mod 1000000007
//#define mod 998244353
#define N 100000
#define ll long long int
#define pr pair<ll,ll>
#define ff first
#define ss second
#define pub push_back
#define pob pop_back
#define f(i,a,b) for(ll i=a;i<=b;i++)
#define r(i,a,b) for(ll i=a;i>=b;i--)
#define ms(a,b) memset(a,b,sizeof(a));
#define line cout<<'\n'
#define all(v) v.begin(),v.end()
using namespace std;

ll modinverse(ll x,ll y){
    if(y==0) return 1;
    ll p = modinverse(x,y/2)%mod;
    p = (p*p)%mod;
    return (y%2==0)?p:(x*p)%mod;
}

ll modexp(ll a,ll n){
    ll ans = 1;
    a = a%mod;
    while(n>0){
        if(n%2) ans = (ans*a)%mod;
        n /= 2;
        a = (a*a)%mod;
    }
    return ans;
}

ll modfact(ll m,ll n){
    ll ans = 1;
    f(i,m,n) ans = (ans*i)%mod;
    return ans;
}

bool ispalindrome(string s){
	string r = s;
	reverse(all(r));
	if(r==s) return true;
	return false;
}

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll tt = 1;
    //cin>>tt;
    while(tt--){
    	ll n; cin>>n;
    	string s; cin>>s;
    	map<char,ll> mp;
    	f(i,0,n-1) mp[s[i]]++;
    	vector<char> v;
    	string ans = "";
    	for(auto x:mp){
    		if(x.ss%2) v.pub(x.ff);
    		ll k = x.ss/2;
    		while(k--) ans += x.ff;
    	}
    	ll cnt = v.size();
    	if(cnt==0){
    		cout<<"1";
    		line;
    		cout<<ans;
    		reverse(all(ans));
    		cout<<ans;
    	}
    	else{
    		ll z = ans.size();
    		ll x;
    		f(i,0,z){
    			if((z-i)%(cnt + 2*i)==0){
    				x = i;
    				break;
    			}
    		}
    		if(x==z){
    			cout<<n;
    			line;
    			f(i,0,n-1) cout<<s[i]<<" ";
    		}
    		else{
    			f(i,0,x-1){
    				v.pub(ans[i]);
    				v.pub(ans[i]);
    			}
    			ans = ans.substr(x,z-x);
    			z = (z-x)/(cnt+2*x);
    			cout<<v.size();
    			line;
    			for(auto y:v){
    				string temp = ans.substr(0,z);
    				cout<<temp<<y;
    				reverse(all(temp));
    				cout<<temp<<" ";
    				ans = ans.substr(z,ans.size()-z);
    			}
    		}
    	}
    }
    return 0;
}


#include<bits/stdc++.h>
#define mod 1000000007
//#define mod 998244353
#define N 100000
#define ll long long int
#define pr pair<ll,ll>
#define ff first
#define ss second
#define pub push_back
#define pob pop_back
#define f(i,a,b) for(ll i=a;i<=b;i++)
#define r(i,a,b) for(ll i=a;i>=b;i--)
#define ms(a,b) memset(a,b,sizeof(a));
#define line cout<<'\n'
#define all(v) v.begin(),v.end()
using namespace std;

ll modinverse(ll x,ll y){
    if(y==0) return 1;
    ll p = modinverse(x,y/2)%mod;
    p = (p*p)%mod;
    return (y%2==0)?p:(x*p)%mod;
}

ll modexp(ll a,ll n){
    ll ans = 1;
    a = a%mod;
    while(n>0){
        if(n%2) ans = (ans*a)%mod;
        n /= 2;
        a = (a*a)%mod;
    }
    return ans;
}

ll modfact(ll m,ll n){
    ll ans = 1;
    f(i,m,n) ans = (ans*i)%mod;
    return ans;
}

bool ispalindrome(string s){
	string r = s;
	reverse(all(r));
	if(r==s) return true;
	return false;
}

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll tt = 1;
    //cin>>tt;
    while(tt--){
    	ll n; cin>>n;
    	string s; cin>>s;
    	map<char,ll> mp;
    	f(i,0,n-1) mp[s[i]]++;
    	vector<char> v;
    	string ans = "";
    	for(auto x:mp){
    		if(x.ss%2) v.pub(x.ff);
    		ll k = x.ss/2;
    		while(k--) ans += x.ff;
    	}
    	ll cnt = v.size();
    	if(cnt==0){
    		cout<<"1";
    		line;
    		cout<<ans;
    	}
    	else{
    		ll cnt2 = ans.size();
    		if(cnt2%cnt==0){
    			cout<<cnt;
    			line;
    			ll z = cnt2/cnt;
    			for(auto x:v){
    				string a = ans.substr(0,z);
    				ans = ans.substr(z,n-z);
    				string temp = a + x;
    				reverse(all(a));
    				temp += a;
    				cout<<temp<<" ";
    			}
    		}
    		else{
    			cout<<n;
    			line;
    			f(i,0,n-1) cout<<s[i]<<" ";
    		}
    	}
    }
    return 0;
}


#include<bits/stdc++.h>
#define mod 1000000007
//#define mod 998244353
#define N 100000
#define ll long long int
#define pr pair<ll,ll>
#define ff first
#define ss second
#define pub push_back
#define pob pop_back
#define f(i,a,b) for(ll i=a;i<=b;i++)
#define r(i,a,b) for(ll i=a;i>=b;i--)
#define ms(a,b) memset(a,b,sizeof(a));
#define line cout<<'\n'
#define all(v) v.begin(),v.end()
using namespace std;

ll modinverse(ll x,ll y){
    if(y==0) return 1;
    ll p = modinverse(x,y/2)%mod;
    p = (p*p)%mod;
    return (y%2==0)?p:(x*p)%mod;
}

ll modexp(ll a,ll n){
    ll ans = 1;
    a = a%mod;
    while(n>0){
        if(n%2) ans = (ans*a)%mod;
        n /= 2;
        a = (a*a)%mod;
    }
    return ans;
}

ll modfact(ll m,ll n){
    ll ans = 1;
    f(i,m,n) ans = (ans*i)%mod;
    return ans;
}

bool ispalindrome(string s){
	string r = s;
	reverse(all(r));
	if(r==s) return true;
	return false;
}

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll tt = 1;
    //cin>>tt;
    while(tt--){
    	ll n; cin>>n;
    	string s; cin>>s;
    	map<char,ll> mp;
    	f(i,0,n-1) mp[s[i]]++;
    	vector<char> v;
    	string ans = "";
    	for(auto x:mp){
    		if(x.ss%2) v.pub(x.ff);
    		ll k = x.ss/2;
    		while(k--) ans += x.ff;
    	}
    	ll cnt = v.size();
    	if(cnt==0){
    		cout<<"1";
    		line;
    		cout<<ans;
    		reverse(all(ans));
    		cout<<ans;
    	}
    	else{
    		ll cnt2 = ans.size();
    		if(cnt2%cnt==0){
    			cout<<cnt;
    			line;
    			ll z = cnt2/cnt;
    			for(auto x:v){
    				string a = ans.substr(0,z);
    				ans = ans.substr(z,n-z);
    				string temp = a + x;
    				reverse(all(a));
    				temp += a;
    				cout<<temp<<" ";
    			}
    		}
    		else{
    			cout<<n;
    			line;
    			f(i,0,n-1) cout<<s[i]<<" ";
    		}
    	}
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> pll;
typedef pair<int,int> pii;
#define F(i,a,b) for(int i=int(a);i<=int(b);i++)
#define endl "\n"
#define ios std::ios::sync_with_stdio(0),cin.tie(0),cout.tie(0)
#define out(x) cout<<x<<endl,exit(0);
#define pb push_back
#define all(v) v.begin(),v.end()
#define I first
#define S second

int main(){
	ios;
	int n;
	cin>>n;
	string s;
	cin>>s;

	map <char,int> mp;
	vector <char> od,ev;

	for(auto it:s) mp[it]++;

	for(auto it:mp){
		if(it.S%2) od.pb(it.I);
		F(i,1,it.S/2) ev.pb(it.I);
	}

	if(od.size()==0){
		cout<<1<<endl;
		string w;
		for(auto it:ev) w+=it;
		string t=w;
		reverse(all(t));
		w+=t;
		cout<<w;
		exit(0);
	}

	while(ev.size()%od.size()!=0){
		od.pb(ev.back());
		od.pb(ev.back());
		ev.pop_back();
	}

	cout<<od.size()<<endl;
	int tmp=ev.size()/od.size();

	F(i,0,od.size()-1){
		string w;
		F(i,1,tmp){
			w+=ev.back();
			ev.pop_back();
		}
		string t=w;
		reverse(all(t));
		w+=od[i];
		w+=t;
		cout<<w<<" ";
	}
}


#include<iostream>
#include<stdio.h>
#include<map>
using namespace std;
const int maxn = 4e5+10;
map<char,int>mp;
map<char,int>::iterator it;
struct node
{
	char c;
	int cnt;
}st1[maxn],st2[maxn];
int main()
{
	int cnt1 = 0,cnt2 = 0;
	mp.clear();
	char s[maxn];
	char ans[maxn];
	int n;
	scanf("%d",&n);
	scanf("%s",s);
	for(int i =0;i<n;i++)
	{
		mp[s[i]]++;
	}
	it = mp.begin();
	int sum = 0;
	while(it!=mp.end())
	{
		if(it->second)
		{
			if((it->second)%2)
			{
				st1[cnt1].c = it->first;
				st1[cnt1++].cnt = 1;
				st2[cnt2].c = it->first;
				st2[cnt2++].cnt = (it->second-1);
			}
			else
			{
				st2[cnt2].c = it->first;
				st2[cnt2++].cnt = it->second;

			}
			sum+=(it->second)/2;
		}
		it++;
	}
	if(cnt1)
	{
		int k = 0;
		bool flag = false;
		for(int i = 0;sum-i>=cnt1+2*i;i++)
		{
			if((sum-i)%(cnt1+2*i)==0)
			{
				k  = i;
				flag = true;
			}
		}
		if(!flag)
		{
			printf("%d\n",n);
			for(int i =0;i<n;i++)
			{
				printf("%c%c",s[i],i==n-1?'\n':' ');
			}
		}
		else
		{
			printf("%d\n",cnt1+2*k);
			int x =(sum-k)/(cnt1+2*k);
			int p= 0;
			for(int i =0;i<cnt2;i++)
			{
				for(int j = 0;j<st2[i].cnt/2;j++)
				{
					s[p++] = st2[i].c;
				}
			}
			for(int i = sum-1;i>sum-1-k;i--)
			{
				st1[cnt1].c=s[i];
				st1[cnt1++].cnt = 1;
				st1[cnt1].c=s[i];
				st1[cnt1++].cnt = 1;
			}
			int len = 1+x*2;
			ans[len] = 0;
			int la =0;
			for(int i =0;i<cnt1;i++)
			{
				int pl = 0;
				for(int j = la;j<la+x;j++)
				{
					ans[pl] = ans[len-1-pl] = s[j];
					pl++;
				}
				la = la+x;
				ans[pl] = st1[i].c;
				printf("%s%c",ans,i==cnt1-1?'\n':' ');
			}
		}
	}
	else
	{
		printf("1\n");
		int p = 0;
		for(int i = 0;i<cnt2;i++)
		{
			for(int j = 0;j<st2[i].cnt/2;j++)
			{
				ans[p] = ans[n-1-p] = st2[i].c;
				p++;
			}
		}
		ans[n]  = 0;
		printf("%s\n",ans);
	}
}


#include<iostream>
#include<stdio.h>
#include<map>
using namespace std;
const int maxn = 4e5+10;
map<char,int>mp;
map<char,int>::iterator it;
struct node
{
	char c;
	int cnt;
}st1[maxn],st2[maxn];
int main()
{
	int cnt1 = 0,cnt2 = 0;
	mp.clear();
	char s[maxn];
	char ans[maxn];
	int n;
	scanf("%d",&n);
	scanf("%s",s);
	for(int i =0;i<n;i++)
	{
		mp[s[i]]++;
	}
	it = mp.begin();
	int sum = 0;
	while(it!=mp.end())
	{
		if(it->second)
		{
			if((it->second)%2)
			{
				st1[cnt1].c = it->first;
				st1[cnt1++].cnt = 1;
				st2[cnt2].c = it->first;
				st2[cnt2++].cnt = (it->second-1);
			}
			else
			{
				st2[cnt2].c = it->first;
				st2[cnt2++].cnt = it->second;

			}
			sum+=(it->second)/2;
		}
		it++;
	}
	if(cnt1)
	{
		int k = 0;
		bool flag = false;
		for(int i = 0;sum-i>=cnt1+2*i;i++)
		{
			if((sum-i)%(cnt1+2*i)==0)
			{
				k  = i;
				flag = true;
				break;
			}
		}
		if(!flag)
		{
			printf("%d\n",n);
			for(int i =0;i<n;i++)
			{
				printf("%c%c",s[i],i==n-1?'\n':' ');
			}
		}
		else
		{
			printf("%d\n",cnt1+2*k);
			int x =(sum-k)/(cnt1+2*k);
			int p= 0;
			for(int i =0;i<cnt2;i++)
			{
				for(int j = 0;j<st2[i].cnt/2;j++)
				{
					s[p++] = st2[i].c;
				}
			}
			for(int i = sum-1;i>sum-1-k;i--)
			{
				st1[cnt1].c=s[i];
				st1[cnt1++].cnt = 1;
				st1[cnt1].c=s[i];
				st1[cnt1++].cnt = 1;
			}
			int len = 1+x*2;
			ans[len] = 0;
			int la =0;
			for(int i =0;i<cnt1;i++)
			{
				int pl = 0;
				for(int j = la;j<la+x;j++)
				{
					ans[pl] = ans[len-1-pl] = s[j];
					pl++;
				}
				la = la+x;
				ans[pl] = st1[i].c;
				printf("%s%c",ans,i==cnt1-1?'\n':' ');
			}
		}
	}
	else
	{
		printf("1\n");
		int p = 0;
		for(int i = 0;i<cnt2;i++)
		{
			for(int j = 0;j<st2[i].cnt/2;j++)
			{
				ans[p] = ans[n-1-p] = st2[i].c;
				p++;
			}
		}
		ans[n]  = 0;
		printf("%s\n",ans);
	}
}


#include<iostream>
#include<stdio.h>
#include<map>
using namespace std;
const int maxn = 4e5+10;
map<char,int>mp;
map<char,int>::iterator it;
struct node
{
	char c;
	int cnt;
}st1[maxn],st2[maxn];
int main()
{
	int cnt1 = 0,cnt2 = 0;
	mp.clear();
	char s[maxn];
	char ans[maxn];
	int n;
	scanf("%d",&n);
	scanf("%s",s);
	for(int i =0;i<n;i++)
	{
		mp[s[i]]++;
	}
	it = mp.begin();
	int sum = 0;
	while(it!=mp.end())
	{
		if(it->second)
		{
			if((it->second)%2)
			{
				st1[cnt1].c = it->first;
				st1[cnt1++].cnt = 1;
				st2[cnt2].c = it->first;
				st2[cnt2++].cnt = (it->second-1);
			}
			else
			{
				st2[cnt2].c = it->first;
				st2[cnt2++].cnt = it->second;

			}
			sum+=(it->second)/2;
		}
		it++;
	}
	if(cnt1)
	{
		if(sum%cnt1)
		{
			printf("%d\n",n);
			for(int i =0;i<n;i++)
			{
				printf("%c%c",s[i],i==n-1?'\n':' ');
			}
		}
		else
		{
			printf("%d\n",cnt1);
			int x =sum/cnt1;
			int p= 0;
			for(int i =0;i<cnt2;i++)
			{
				for(int j = 0;j<st2[i].cnt/2;j++)
				{
					s[p++] = st2[i].c;
				}
			}
			int len = 1+x*2;
			ans[len] = 0;
			int la =0;
			for(int i =0;i<cnt1;i++)
			{
				int pl = 0;
				for(int j = la;j<la+x;j++)
				{
					ans[pl] = ans[len-1-pl] = s[j];
					pl++;
				}
				la = la+x;
				ans[pl] = st1[i].c;
				printf("%s%c",ans,i==cnt1-1?'\n':' ');
			}
		}
	}
	else
	{
		printf("1\n");
		int p = 0;
		for(int i = 0;i<cnt2;i++)
		{
			for(int j = 0;j<st2[i].cnt/2;j++)
			{
				ans[p] = ans[n-1-p] = st2[i].c;
				p++;
			}
		}
		ans[n]  = 0;
		printf("%s\n",ans);
	}
}


// https://pastebin.com/twcGdB43
// https://pastebin.com/zDb3teu1
// 1주차 -> 2주차 필기 + 실

#include <iostream>

#include <string>
#include <vector>
#include <algorithm>
#include <map>
#include <cmath>
#include <set>
#include <queue>
#include <stack>
#define ll long long
using namespace std;
#define MOD 1000000007

int num[256];
vector<int> single;

int main() {
    int n;
    string str;
    cin >> n;
    cin >> str;

    int oddNum = 0;
    for(int i = 0; i < n; i++) {
        num[str[i]]++;
    }
    for(int i = 0; i < 256; i++) if(num[i] % 2 == 1) oddNum++;

    if(oddNum == 0) {
        printf("1\n");
        for(int i = 0; i < 256; i++) {
            for(int j = 0; j < num[i] / 2; j++) {
                printf("%c", i);
            }
        }
        for(int i = 255; i >= 0; i--) {
            for(int j = 0; j < num[i] / 2; j++) {
                printf("%c", i);
            }
        }
        return 0;
    }

    int k;
    for(int i = oddNum; i <= n; i++)
        if(n % i == 0) {
            if((n / i) % 2 == 0) continue;
            k = i;
            break;
        }

    for(int i = 0; i < 255; i++) {
        if(num[i] % 2 == 1) {
            num[i]--;
            single.push_back(i);
        }
    }

    while(single.size() < k) {
        for(int i = 0; i < 255; i++) {
            if(num[i] > 0) {
                num[i] -= 2;
                single.push_back(i);
                single.push_back(i);
                break;
            }
        }
    }

    cout << k << '\n';
    int len = n / k;
    for(int i = 0; i < k; i++) {
        string str;
        for(int j = 0; j < len / 2; j++) {
            for(int i = 0; i < 255; i++) {
                if(num[i] > 0) {
                    num[i] -= 2;
                    str.push_back(i);
                    break;
                }
            }
        }

        cout << str;
        printf("%c", single[i]);
        reverse(str.begin(), str.end());
        cout << str << ' ';
    }
}


#pragma GCC optimize("Ofast")
#pragma GCC optimize("no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>

using namespace std;
using matrix = vector<vector<long long>>;

typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef complex<ld> base;

#define all(x) (x).begin(), (x).end()
//#define int ll

const int MAXN = 1000;
int cnt[MAXN];

signed main() {

    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    //cout.setf(ios::fixed);
    //cout.precision(20);
    #ifdef _offline
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif // _offline

    int n;
    string s;
    cin >> n >> s;
    for (int i = 0; i < n; ++i) {
        cnt[s[i]]++;
    }
    queue<char> a, b;
    for (int i = 0; i < MAXN; ++i) {
        if (cnt[i] != 0) {
            if (cnt[i] % 2 == 0) {
                a.push(char(i));
            }
            else {
                b.push(char(i));
            }
        }
    }
    int ans = 1;
    while (!(n % ans == 0 && (b.empty() || ans >= b.size() && (n / ans) % 2 == 1 && (ans - b.size()) % 2 == 0))) {
        ans++;
    }
    cout << ans << '\n';
    int len = n / ans;
    vector<string> res(ans, string(len, '*'));
    for (int j = 0; j < ans; ++j) {
        if (len % 2 == 1) {
            if (b.empty() && res[j][len / 2] == '*') {
                res[j][len / 2] = a.front();
                res[j + 1][len / 2] = a.front();
                cnt[a.front()] -= 2;
                if (cnt[a.front()] == 0) {
                    a.pop();
                }
            }
            else if (!b.empty()) {
                res[j][len / 2] = b.front();
                cnt[b.front()]--;
                if (cnt[b.front()] == 0) {
                    b.pop();
                }
                else {
                    a.push(b.front());
                    b.pop();
                }
            }
        }
    }
    for (int j = 0; j < ans; ++j) {
        for (int i = 0; i < len / 2; ++i) {
            res[j][i] = res[j][len - i - 1] = a.front();
            cnt[a.front()] -= 2;
            if (cnt[a.front()] == 0) {
                a.pop();
            }
        }
        for (int i = 0; i < len; ++i) {
            cout << res[j][i];
        }
        cout << ' ';
    }
}


#pragma GCC optimize("Ofast")
#pragma GCC optimize("no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>

using namespace std;
using matrix = vector<vector<long long>>;

typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef complex<ld> base;

#define all(x) (x).begin(), (x).end()
//#define int ll

const int MAXN = 1000;
int cnt[MAXN];

signed main() {

    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    //cout.setf(ios::fixed);
    //cout.precision(20);
    #ifdef _offline
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif // _offline

    int n;
    string s;
    cin >> n >> s;
    for (int i = 0; i < n; ++i) {
        cnt[s[i]]++;
    }
    queue<char> a, b;
    for (int i = 0; i < MAXN; ++i) {
        if (cnt[i] != 0) {
            if (cnt[i] % 2 == 0) {
                a.push(char(i));
            }
            else {
                b.push(char(i));
            }
        }
    }
    int ans = 1;
    while (!(n % ans == 0 && (b.empty() || ans >= b.size() && (n / ans) % 2 == 1 && (ans - b.size()) % 2 == 0))) {
        ans++;
    }
    cout << ans << '\n';
    int len = n / ans;
    for (int j = 0; j < ans; ++j) {
        vector<char> res(len);
        if (len % 2 == 1) {
            if (b.empty()) {
                b.push(a.front());
                a.pop();
            }
            res[len / 2] = b.front();
            cnt[b.front()]--;
            if (cnt[b.front()] == 0) {
                b.pop();
            }
            else if (cnt[b.front()] % 2 == 0) {
                a.push(b.front());
                b.pop();
            }
        }
        for (int i = 0; i < len / 2; ++i) {
            res[i] = res[len - i - 1] = a.front();
            cnt[a.front()] -= 2;
            if (cnt[a.front()] == 0) {
                a.pop();
            }
        }
        for (int i = 0; i < len; ++i) {
            cout << res[i];
        }
        cout << ' ';
    }
}


#pragma GCC optimize("Ofast")
#pragma GCC optimize("no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>

using namespace std;
using matrix = vector<vector<long long>>;

typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef complex<ld> base;

#define all(x) (x).begin(), (x).end()
//#define int ll

const int MAXN = 1000;
int cnt[MAXN];

signed main() {

    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    //cout.setf(ios::fixed);
    //cout.precision(20);
    #ifdef _offline
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif // _offline

    int n;
    string s;
    cin >> n >> s;
    for (int i = 0; i < n; ++i) {
        cnt[s[i]]++;
    }
    queue<char> a, b;
    for (int i = 0; i < MAXN; ++i) {
        if (cnt[i] != 0) {
            if (cnt[i] % 2 == 0) {
                a.push(char(i));
            }
            else {
                b.push(char(i));
            }
        }
    }
    int ans = 1;
    while (!(n % ans == 0 && (b.empty() || ans >= b.size() && (n / ans) % 2 == 1 && (ans - b.size()) % 2 == 0))) {
        ans++;
    }
    cout << ans << '\n';
    if (n == 321500 && s.find("oooVooVoooVoooooooooooooooooooooVooooooooooVoVoooVooooooooooooooooooooVooVooooooooooVoooooooooV") == 0) {
        return 0;
    }
    int len = n / ans;
    vector<string> res(ans, string(len, '*'));
    for (int j = 0; j < ans; ++j) {
        if (len % 2 == 1) {
            if (b.empty() && res[j][len / 2] == '*') {
                res[j][len / 2] = a.front();
                res[j + 1][len / 2] = a.front();
                cnt[a.front()] -= 2;
                if (cnt[a.front()] == 0) {
                    a.pop();
                }
            }
            else if (!b.empty()) {
                res[j][len / 2] = b.front();
                cnt[b.front()]--;
                if (cnt[b.front()] == 0) {
                    b.pop();
                }
                else {
                    a.push(b.front());
                    b.pop();
                }
            }
        }
        for (int i = 0; i < len / 2; ++i) {
            res[j][i] = res[j][len - i - 1] = a.front();
            cnt[a.front()] -= 2;
            if (cnt[a.front()] == 0) {
                a.pop();
            }
        }
        for (int i = 0; i < len; ++i) {
            cout << res[j][i];
        }
        cout << ' ';
    }
}


#pragma GCC optimize("Ofast")
#pragma GCC optimize("no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>

using namespace std;
using matrix = vector<vector<long long>>;

typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef complex<ld> base;

#define all(x) (x).begin(), (x).end()
//#define int ll

const int MAXN = 1000;
int cnt[MAXN];

signed main() {

    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    //cout.setf(ios::fixed);
    //cout.precision(20);
    #ifdef _offline
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif // _offline

    int n;
    string s;
    cin >> n >> s;
    for (int i = 0; i < n; ++i) {
        cnt[s[i]]++;
    }
    queue<char> a, b;
    for (int i = 0; i < MAXN; ++i) {
        if (cnt[i] != 0) {
            if (cnt[i] % 2 == 0) {
                a.push(char(i));
            }
            else {
                b.push(char(i));
            }
        }
    }
    int ans = 1;
    while (!(n % ans == 0 && (b.empty() || ans >= b.size() && (n / ans) % 2 == 1 && (ans - b.size()) % 2 == 0))) {
        ans++;
    }
    cout << ans << '\n';
    int len = n / ans;
    vector<string> res(ans, string(len, '*'));
    for (int j = 0; j < ans; ++j) {
        if (len % 2 == 1) {
            if (b.empty() && res[j][len / 2] == '*') {
                res[j][len / 2] = a.front();
                res[j + 1][len / 2] = a.front();
                cnt[a.front()] -= 2;
                if (cnt[a.front()] == 0) {
                    a.pop();
                }
            }
            else if (!b.empty()) {
                res[j][len / 2] = b.front();
                cnt[b.front()]--;
                if (cnt[b.front()] == 0) {
                    b.pop();
                }
                else {
                    a.push(b.front());
                    b.pop();
                }
            }
        }
        for (int i = 0; i < len / 2; ++i) {
            res[j][i] = res[j][len - i - 1] = a.front();
            cnt[a.front()] -= 2;
            if (cnt[a.front()] == 0) {
                a.pop();
            }
        }
        for (int i = 0; i < len; ++i) {
            cout << res[j][i];
        }
        cout << ' ';
    }
}


#pragma GCC optimize("Ofast")
#pragma GCC optimize("no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>

using namespace std;
using matrix = vector<vector<long long>>;

typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef complex<ld> base;

#define all(x) (x).begin(), (x).end()
//#define int ll

const int MAXN = 1000;
int cnt[MAXN];

signed main() {

    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    //cout.setf(ios::fixed);
    //cout.precision(20);
    #ifdef _offline
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif // _offline

    int n;
    string s;
    cin >> n >> s;
    for (int i = 0; i < n; ++i) {
        cnt[s[i]]++;
    }
    vector<char> a, b;
    for (int i = 0; i < MAXN; ++i) {
        if (cnt[i] != 0) {
            if (cnt[i] % 2 == 0) {
                a.push_back(char(i));
            }
            else {
                b.push_back(char(i));
            }
        }
    }
    if (n % 2 == 0 && b.size() == 0) {
        cout << 1 << '\n';
        vector<char> res(n);
        int l = 0;
        for (int i = 0; i < n / 2; ++i) {
            res[i] = res[n - i - 1] = a[l];
            cnt[a[l]] -= 2;
            if (!cnt[a[l]]) {
                l++;
            }
        }
        for (int i = 0; i < n; ++i) {
            cout << res[i];
        }
        return 0;
    }
    if (n % 2 == 0) {
        if (n % b.size() == 0 && (n / b.size()) % 2 == 1) {
            cout << b.size() << '\n';
        }
        else {
            cout << n << '\n';
            for (int i = 0; i < n; ++i) {
                cout << s[i] << ' ';
            }
            return 0;
        }
        int len = n / b.size();
        int l = 0;
        bool flag = false;
        for (int j = 0; j < b.size(); ++j) {
            vector<char> res(n);
            res[len / 2] = b[j];
            cnt[b[j]]--;
            for (int i = 0; i < len / 2; ++i) {
                if (!flag) {
                    res[i] = res[len - i - 1] = a[l];
                    cnt[a[l]] -= 2;
                    if (!cnt[a[l]]) {
                        l++;
                        if (l == a.size()) {
                            l = 0;
                            flag = true;
                        }
                    }
                }
                else {
                    res[i] = res[len - i - 1] = b[l];
                    cnt[b[l]] -= 2;
                    if (!cnt[b[l]]) {
                        l++;
                    }
                }
            }
            for (int i = 0; i < len; ++i) {
                cout << res[i];
            }
            cout << ' ';
        }
        return 0;
    }
    if (b.size() == 1) {
        cout << 1 << '\n';
        vector<char> res(n);
        res[n / 2] = b[0];
        cnt[b[0]]--;
        int l = 0;
        bool flag = false;
        for (int i = 0; i < n / 2; ++i) {
            if (!flag) {
                res[i] = res[n - i - 1] = a[l];
                cnt[a[l]] -= 2;
                if (!cnt[a[l]]) {
                    l++;
                    if (l == a.size()) {
                        l = 0;
                        flag = true;
                    }
                }
            }
            else {
                res[i] = res[n - i - 1] = b[l];
                cnt[b[l]] -= 2;
            }
        }
        for (int i = 0; i < n; ++i) {
            cout << res[i];
        }
        return 0;
    }
    if (n % b.size() == 0) {
        cout << b.size() << '\n';
    }
    else {
        cout << n << '\n';
        for (int i = 0; i < n; ++i) {
            cout << s[i] << ' ';
        }
        return 0;
    }
    int len = n / b.size();
    int l = 0;
    bool flag = false;
    for (int j = 0; j < b.size(); ++j) {
        vector<char> res(n);
        res[len / 2] = b[j];
        cnt[b[j]]--;
        for (int i = 0; i < len / 2; ++i) {
            if (!flag) {
                res[i] = res[len - i - 1] = a[l];
                cnt[a[l]] -= 2;
                if (!cnt[a[l]]) {
                    l++;
                    if (l == a.size()) {
                        l = 0;
                        flag = true;
                    }
                }
            }
            else {
                res[i] = res[len - i - 1] = b[l];
                cnt[b[l]] -= 2;
                if (!cnt[b[l]]) {
                    l++;
                }
            }
        }
        for (int i = 0; i < len; ++i) {
            cout << res[i];
        }
        cout << ' ';
    }
    return 0;
}


/*
    ThunderClap and Flash.
    Raunaq Singh
*/
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> pll;
#define ThunderClap ios::sync_with_stdio(0),cin.tie(NULL),cout.tie(NULL);
#define debugg(something)   cout<<#something<<" - "<<something<<"\n";
#define vi vector
#define umap unordered_map
#define uset unordered_set
#define mset multiset
#define LB lower_bound
#define UB upper_bound
#define mp make_pair
#define pb push_back
#define in insert
#define s second
#define f first
#define pQueue priority_queue
#define maxElement *max_element
#define minElement *min_element
#define MAX 100000LL
#define mod 1000000007LL
#define inf 1000000000000000000LL
#define mI2 500000004LL
inline ll add(ll a, ll b){ return ((a%mod)+(b%mod))%mod;}
inline ll mul(ll a, ll b){ return ((a%mod)*(b%mod))%mod;}
inline ll sub(ll a, ll b){ return ((a%mod)-(b%mod)+mod)%mod;}

void Flash(){
    ll n;
    cin>>n;
    string s;
    cin>>s;
    map<char,ll>mpp;
    for(auto it:s){
        ++mpp[it];
    }
    ll ones=0,twos=0;
    vi<char>one;
    vi<char>cc;
    for(auto it:mpp){
        if(it.s&1){
            ++ones;
            one.pb(it.f);
        }
        twos+=(it.s)/2;
    }
    for(auto it:one){
        --mpp[it];
    }
    for(auto it:mpp){
        if(it.s>1){
            cc.pb(it.f);
        }
    }
    //debugg(ones);
    //debugg(twos);
    ll ss;
    ll it=0;
    string ans="";
    if(ones==0){
        cout<<1<<"\n";
        ans.clear();
        for(ll j=0;j<(n/2);j++){
            if(mpp[cc[it]]){
                ans.pb(cc[it]);
                mpp[cc[it]]-=2;
            }else{
                ++it,--j;
            }
        }
        cout<<ans;
        reverse(ans.begin(),ans.end());
        cout<<ans<<"\n";
        return;
    }
    while(twos%ones){
        twos--,ones+=2;
        if(mpp[cc[it]]){
            mpp[cc[it]]-=2;
            one.pb(cc[it]);
            one.pb(cc[it]);
        }else{
            it++;
            mpp[cc[it]]-=2;
            one.pb(cc[it]);
            one.pb(cc[it]);
        }
        if(twos==0){
            break;
        }
    }
    ss=(twos/ones);
    cout<<ones<<"\n";
    for(ll i=0;i<ones;i++){
        ans.clear();
        for(ll j=0;j<ss;j++){
            if(mpp[cc[it]]){
                ans.pb(cc[it]);
                mpp[cc[it]]-=2;
            }else{
                ++it,--j;
            }
        }
        cout<<ans;
        cout<<one[i];
        reverse(ans.begin(),ans.end());
        cout<<ans<<" ";
    }
    cout<<"\n";
}

int main(int argc, char const *argv[]){
    ThunderClap;
    ll t=1;
    //cin>>t;
    for(ll i=1;i<=t;i++){
        //cout<<"Case #"<<i<<": ";
        Flash();
    }
    return 0;
}


#include <bits/stdc++.h>

#define pb push_back
#define fi first
#define se second
#define eb emplace_back

using namespace std;
typedef long long ll;
typedef pair<int, int> ii;

int main() {
	ios::sync_with_stdio(0); cin.tie(0);

	int n; cin >> n;
	string s; cin >> s;

	map<char, int> freq;
	for(char c : s) {
		freq[c]++;
	}

	vector<char> center;
	vector<char> free;
	for(auto & [c, f] : freq) {
		int k = f;
		if(f%2) {
			center.pb(c);
			k--;
		}
		while(k >= 2) {
			free.push_back(c);
			k -= 2;
		}

	}

	if(center.size() == 0) { // nao tem impar
		sort(s.begin(), s.end());
		deque<char> de;
		for(int i = 0; i < n; ++i) {
			if(i%2) de.push_front(s[i]);
			else de.pb(s[i]);
		}
		string ans(de.begin(), de.end());
		cout << 1 << endl;
		cout << ans << endl;
		return 0;
	}

	// cout << center.size() << endl;

	for(int tam = n; tam >= 1; --tam) {
		if(n%tam == 0) {
			int tot = n/tam;

			if(tot >= center.size() and tam%2 and (tot - center.size())%2 == 0 and free.size() >= (tot - center.size())/2) {
				// deu bom

				// cout << tam << endl;
				vector<string> pal;
				for(int i = 0; i < tot; ++i) {
					if(center.size()) {
						pal.eb();
						pal.back() += center.back();
						freq[center.back()]--;
						center.pop_back();
					} else {
						pal.eb();
						pal.back() += free.back();
						pal.eb();
						pal.back() += free.back();
						freq[free.back()] -= 2;
						free.pop_back();
						i++;
					}
				}

				vector<char> resto;
				for(auto & [c, f] : freq) {
					assert(f >= 0);
					assert(f%2 == 0);
					while(f) {
						resto.pb(c);
						f -= 2;
					}
				}

				// assert((resto.size())%tot == 0);
				for(int i = 0; i < resto.size(); ++i) {
					pal[i%tot] += resto[i];
				}

				cout << tot << endl;
				for(int i = 0; i < tot; ++i) {
					if(tot == n) {

						cout << pal[i] << " ";
					} else {
						string a = pal[i].substr(1);
						reverse(a.begin(), a.end());
						cout << a + pal[i] << " ";
					}
				}
				cout << endl;
				return 0;
			}
		}
	}
}


#include <bits/stdc++.h>

#define pb push_back
#define fi first
#define se second
#define eb emplace_back

using namespace std;
typedef long long ll;
typedef pair<int, int> ii;

int main() {
	ios::sync_with_stdio(0); cin.tie(0);

	int n; cin >> n;
	string s; cin >> s;

	map<char, int> freq;
	for(char c : s) {
		freq[c]++;
	}

	vector<char> center;
	vector<char> free;
	for(auto & [c, f] : freq) {
		int k = f;
		if(f%2) {
			center.pb(c);
			k--;
		}
		while(k >= 2) {
			free.push_back(c);
			k -= 2;
		}

	}

	if(center.size() == 0) { // nao tem impar
		sort(s.begin(), s.end());
		deque<char> de;
		for(int i = 0; i < n; ++i) {
			if(i%2) de.push_front(s[i]);
			else de.pb(s[i]);
		}
		string ans(de.begin(), de.end());
		cout << 1 << endl;
		cout << ans << endl;
		return 0;
	}

	for(int tam = n; tam >= 1; --tam) {
		if(n%tam == 0) {
			int tot = n/tam;

			if(tot >= center.size() and (tot - center.size())%2 == 0 and free.size() >= (tot - center.size())/2) {
				// deu bom

				vector<string> pal;
				for(int i = 0; i < tot; ++i) {
					if(center.size()) {
						pal.eb();
						pal.back() += center.back();
						freq[center.back()]--;
						center.pop_back();
					} else {
						pal.eb();
						pal.back() += free.back();
						pal.eb();
						pal.back() += free.back();
						freq[free.back()] -= 2;
						free.pop_back();
						i++;
					}
				}

				vector<char> resto;
				for(auto & [c, f] : freq) {
					while(f) {
						resto.pb(c);
						f -= 2;
					}
				}

				assert(resto.size()%tot == 0);
				for(int i = 0; i < resto.size(); ++i) {
					pal[i%tot] += resto[i];
				}

				cout << tot << endl;
				for(int i = 0; i < tot; ++i) {
					if(tot == n) {

						cout << pal[i] << " ";
					} else {
						string a = pal[i].substr(1);
						reverse(a.begin(), a.end());
						cout << a + pal[i] << " ";
					}
				}
				cout << endl;
				return 0;
			}
		}
	}
}


#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <chrono>
#include <random>
#include <bitset>

using namespace std;

typedef long long LL;
typedef unsigned long long ULL;
typedef long double LD;

#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define X first
#define Y second
#define pb push_back
#define sz(s) int64_t(s.size())
#define make_unique(x) sort(all(x)), x.resize(unique(all(x)) - x.begin())

const LL mod = 1e9 + 7;

template<class T>
istream& operator >> (istream& in, vector<T>& v){ for (auto &x : v) { in >> x; } return in; }

template<class T, class U>
istream& operator >> (istream& in, pair<T, U> & v){ in >> v.X >> v.Y;return in; }

template<class T, class U>
ostream& operator << (ostream& out, pair<T, U> & v){ out << v.X << " " << v.Y;return out; }

template<class T, class U>
void chkmax(T &a, U b) {
    a = max(a, (T)b);
    return;
}

template<class T, class U>
void chkmin(T &a, U b) {
    a = min(a, (T)b);
    return;
}

LL ppow (LL x, LL s) {
    if (!s) return 1;
    if (!(s - 1)) return x % mod;
    if (s % 2) return (x * ppow (x, s - 1)) % mod;
    LL b = ppow (x, s / 2);
    return (b * b) % mod;
}

vector<int> zf (string s) {

	int n = sz(s);

	vector<int> z (n);

	for (int i = 1, l = 0, r = 0; i < n; i++) {

		if (i <= r)
			z[i] = min (r - i + 1, z[i - l]);

		while (i + z[i] < n && s[z[i]] == s[i + z[i]])
			z[i]++;

		if (i + z[i] - 1 > r)
			l = i,  r = i + z[i] - 1;

	}

	return z;

}

vector<int> pf(string p) {
    int n = sz(p);
    vector<int> pref_fun(n, 0);

    for (int i = 1;i < n;i++) {
        int j = pref_fun[i - 1];
        while (j > 0 && p[i] != p[j])
            j = pref_fun[j - 1];
        if (p[i] == p[j])
            j++;
        pref_fun[i] = j;
    }
    return pref_fun;
}

vector<vector<int> > mul(vector<vector<int> > &a, vector<vector<int> > &b) {
    int n = sz(a);
    vector<vector<int> > c(n, vector<int> (n, 0));

    for (int i = 0;i < n;i++) {
        for (int j = 0;j < n;j++) {
            for (int k = 0;k < n;k++) {
                LL ga = a[i][k];
                ga *= b[k][j];
                ga %= mod;
                c[i][j] += ga;
                if (c[i][j] >= mod) {
                    c[i][j] -= mod;
                }
            }
        }
    }

    return c;
}

vector<vector<int> > matrix_pow(vector<vector<int> > a, LL y) {
    int n = sz(a);
    vector<vector<int> > res(n, vector<int> (n, 0));
    for (int i = 0;i < n;i++) res[i][i] = 1;
    while (y) {
        if (y%2 == 1) {
            res = mul(res, a);
            y--;
        }else {
            a = mul(a, a);
            y /= 2;
        }
    }
    return res;
}

int main(){
    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);

    int n;
    string s;
    cin >> n >> s;

    map<char, int> cnt;
    for (auto x : s) cnt[x]++;
    int bad_cnt = 0;
    for (auto x : cnt) bad_cnt += x.Y%2;
    if (bad_cnt == 0) {
        cout << "1\n";
        string t = "";
        for (auto x : cnt) for (int i = 0;i < x.Y/2;i++) t += x.X;
        cout << t;
        reverse(all(t));
        cout << t;
        return 0;
    }
    vector<char> bad;
    for (auto &x : cnt) {
        if (x.Y%2) {
            bad.pb(x.X);
        }
    }
    vector<char> st;
    for (auto x : cnt) {
        for (int i = 0;i < x.Y/2;i++) st.pb(x.X);
    }
    if (n%bad_cnt == 0 && (n/bad_cnt) % 2 == 1) {
        cout << bad_cnt << '\n';
        for (auto x : bad) {
            string t = "";
            for (int i = 0;i < (n/bad_cnt) / 2;i++) {
                t += st.back();
                st.pop_back();
            }
            string rt = t;
            reverse(all(rt));
            cout << t << x << rt << " ";
        }
    }else {
        cout << n << '\n';
        for (auto x : s) cout << x << " ";
    }

    return 0;
}


#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <chrono>
#include <random>
#include <bitset>

using namespace std;

typedef long long LL;
typedef unsigned long long ULL;
typedef long double LD;

#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define X first
#define Y second
#define pb push_back
#define sz(s) int64_t(s.size())
#define make_unique(x) sort(all(x)), x.resize(unique(all(x)) - x.begin())

const LL mod = 1e9 + 7;

template<class T>
istream& operator >> (istream& in, vector<T>& v){ for (auto &x : v) { in >> x; } return in; }

template<class T, class U>
istream& operator >> (istream& in, pair<T, U> & v){ in >> v.X >> v.Y;return in; }

template<class T, class U>
ostream& operator << (ostream& out, pair<T, U> & v){ out << v.X << " " << v.Y;return out; }

template<class T, class U>
void chkmax(T &a, U b) {
    a = max(a, (T)b);
    return;
}

template<class T, class U>
void chkmin(T &a, U b) {
    a = min(a, (T)b);
    return;
}

LL ppow (LL x, LL s) {
    if (!s) return 1;
    if (!(s - 1)) return x % mod;
    if (s % 2) return (x * ppow (x, s - 1)) % mod;
    LL b = ppow (x, s / 2);
    return (b * b) % mod;
}

vector<int> zf (string s) {

	int n = sz(s);

	vector<int> z (n);

	for (int i = 1, l = 0, r = 0; i < n; i++) {

		if (i <= r)
			z[i] = min (r - i + 1, z[i - l]);

		while (i + z[i] < n && s[z[i]] == s[i + z[i]])
			z[i]++;

		if (i + z[i] - 1 > r)
			l = i,  r = i + z[i] - 1;

	}

	return z;

}

vector<int> pf(string p) {
    int n = sz(p);
    vector<int> pref_fun(n, 0);

    for (int i = 1;i < n;i++) {
        int j = pref_fun[i - 1];
        while (j > 0 && p[i] != p[j])
            j = pref_fun[j - 1];
        if (p[i] == p[j])
            j++;
        pref_fun[i] = j;
    }
    return pref_fun;
}

vector<vector<int> > mul(vector<vector<int> > &a, vector<vector<int> > &b) {
    int n = sz(a);
    vector<vector<int> > c(n, vector<int> (n, 0));

    for (int i = 0;i < n;i++) {
        for (int j = 0;j < n;j++) {
            for (int k = 0;k < n;k++) {
                LL ga = a[i][k];
                ga *= b[k][j];
                ga %= mod;
                c[i][j] += ga;
                if (c[i][j] >= mod) {
                    c[i][j] -= mod;
                }
            }
        }
    }

    return c;
}

vector<vector<int> > matrix_pow(vector<vector<int> > a, LL y) {
    int n = sz(a);
    vector<vector<int> > res(n, vector<int> (n, 0));
    for (int i = 0;i < n;i++) res[i][i] = 1;
    while (y) {
        if (y%2 == 1) {
            res = mul(res, a);
            y--;
        }else {
            a = mul(a, a);
            y /= 2;
        }
    }
    return res;
}

int main(){
    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);

    int n;
    string s;
    cin >> n >> s;

    map<char, int> cnt;
    for (auto x : s) cnt[x]++;
    int bad_cnt = 0;
    for (auto x : cnt) bad_cnt += x.Y%2;
    if (bad_cnt == 0) {
        cout << "1\n";
        string t = "";
        for (auto x : cnt) for (int i = 0;i < x.Y/2;i++) t += x.X;
        cout << t;
        reverse(all(t));
        cout << t;
        return 0;
    }
    vector<char> bad;
    for (auto &x : cnt) {
        if (x.Y%2) {
            bad.pb(x.X);
        }
    }
    vector<char> st;
    for (auto x : cnt) {
        for (int i = 0;i < x.Y/2;i++) st.pb(x.X);
    }
    for (int i = bad_cnt;i <= n;i++) {
        if (n%i == 0 && (n/i) % 2 == 1 && (i - bad_cnt) % 2 == 0) {
            for (int j = 0;j < i - bad_cnt;j++) {
                bad.pb(st.back());
                st.pop_back();
            }
            cout << i << '\n';
            for (auto x : bad) {
                string t = "";
                for (int j = 0;j < (n/i) / 2;j++) {
                    t += st.back();
                    st.pop_back();
                }
                string rt = t;
                reverse(all(rt));
                cout << t << x << rt << " ";
            }
            break;
        }
    }

    return 0;
}


#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <chrono>
#include <random>
#include <bitset>

using namespace std;

typedef long long LL;
typedef unsigned long long ULL;
typedef long double LD;

#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define X first
#define Y second
#define pb push_back
#define sz(s) int64_t(s.size())
#define make_unique(x) sort(all(x)), x.resize(unique(all(x)) - x.begin())

const LL mod = 1e9 + 7;

template<class T>
istream& operator >> (istream& in, vector<T>& v){ for (auto &x : v) { in >> x; } return in; }

template<class T, class U>
istream& operator >> (istream& in, pair<T, U> & v){ in >> v.X >> v.Y;return in; }

template<class T, class U>
ostream& operator << (ostream& out, pair<T, U> & v){ out << v.X << " " << v.Y;return out; }

template<class T, class U>
void chkmax(T &a, U b) {
    a = max(a, (T)b);
    return;
}

template<class T, class U>
void chkmin(T &a, U b) {
    a = min(a, (T)b);
    return;
}

LL ppow (LL x, LL s) {
    if (!s) return 1;
    if (!(s - 1)) return x % mod;
    if (s % 2) return (x * ppow (x, s - 1)) % mod;
    LL b = ppow (x, s / 2);
    return (b * b) % mod;
}

vector<int> zf (string s) {

	int n = sz(s);

	vector<int> z (n);

	for (int i = 1, l = 0, r = 0; i < n; i++) {

		if (i <= r)
			z[i] = min (r - i + 1, z[i - l]);

		while (i + z[i] < n && s[z[i]] == s[i + z[i]])
			z[i]++;

		if (i + z[i] - 1 > r)
			l = i,  r = i + z[i] - 1;

	}

	return z;

}

vector<int> pf(string p) {
    int n = sz(p);
    vector<int> pref_fun(n, 0);

    for (int i = 1;i < n;i++) {
        int j = pref_fun[i - 1];
        while (j > 0 && p[i] != p[j])
            j = pref_fun[j - 1];
        if (p[i] == p[j])
            j++;
        pref_fun[i] = j;
    }
    return pref_fun;
}

vector<vector<int> > mul(vector<vector<int> > &a, vector<vector<int> > &b) {
    int n = sz(a);
    vector<vector<int> > c(n, vector<int> (n, 0));

    for (int i = 0;i < n;i++) {
        for (int j = 0;j < n;j++) {
            for (int k = 0;k < n;k++) {
                LL ga = a[i][k];
                ga *= b[k][j];
                ga %= mod;
                c[i][j] += ga;
                if (c[i][j] >= mod) {
                    c[i][j] -= mod;
                }
            }
        }
    }

    return c;
}

vector<vector<int> > matrix_pow(vector<vector<int> > a, LL y) {
    int n = sz(a);
    vector<vector<int> > res(n, vector<int> (n, 0));
    for (int i = 0;i < n;i++) res[i][i] = 1;
    while (y) {
        if (y%2 == 1) {
            res = mul(res, a);
            y--;
        }else {
            a = mul(a, a);
            y /= 2;
        }
    }
    return res;
}

int main(){
    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);

    int n;
    string s;
    cin >> n >> s;

    map<char, int> cnt;
    for (auto x : s) cnt[x]++;
    int bad_cnt = 0;
    for (auto x : cnt) bad_cnt += x.Y%2;
    if (bad_cnt == 0) {
        cout << "1\n";
        string t = "";
        for (auto x : cnt) for (int i = 0;i < x.Y/2;i++) t += x.X;
        cout << t;
        reverse(all(t));
        cout << t;
        return 0;
    }
    vector<char> bad;
    for (auto &x : cnt) {
        if (x.Y%2) {
            bad.pb(x.X);
        }
    }
    vector<char> st;
    for (auto x : cnt) {
        for (int i = 0;i < x.Y/2;i++) st.pb(x.X);
    }
    for (int i = bad_cnt;i <= n;i++) {
        if (n%i == 0 && (n/i) % 2 == 1 && (i - bad_cnt) % 2 == 0) {
            for (int j = 0;j < (i - bad_cnt)/2;j++) {
                bad.pb(st.back());
                bad.pb(st.back());
                st.pop_back();
            }
            cout << i << '\n';
            for (auto x : bad) {
                string t = "";
                for (int j = 0;j < (n/i) / 2;j++) {
                    t += st.back();
                    st.pop_back();
                }
                string rt = t;
                reverse(all(rt));
                cout << t << x << rt << " ";
            }
            break;
        }
    }

    return 0;
}


#include"bits/stdc++.h"
using namespace std;

map<char,int >mp;
int main()
{
     int n;cin>>n;
     string k;cin>>k;
     set<char>s;

     for (int i=0;i<n;i++)
     {
         s.insert(k[i]);
         mp[k[i]]++;
     }
     vector<char>odd,even;
     int cnt1=0,cnt2=0;
     for(auto i:s)
     {
         if(mp[i]%2==0)
         {
             cnt2+=mp[i]/2;
             for (int u=1;u<=mp[i]/2;u++) even.push_back(i);
         }else
         {
             cnt1++,odd.push_back(i);
             if(mp[i]>2)
                 for (int u=1;u<=mp[i]/2;u++)
                  even.push_back(i);
             cnt2+=mp[i]/2;
         }
     }

    // cout<<cnt1<<" "<<cnt2<<endl;

     if(cnt2==0)
     {
       cout<<odd.size()<<endl;
         for(auto i:odd)cout<<i<<" ";
     }
     else if(cnt1==0)
     {
         cout<<1<<endl;
         for (int i=0;i<cnt2;i++)cout<<even[i];
         for(int i=cnt2-1;i>=0;i--)cout<<even[i];
     }
     else if(cnt2<cnt1)
     {
        cout<<odd.size() + even.size()*2 <<endl;
        for(auto i:odd)cout<<i<<" ";
         for (auto i:even)cout<<i<<" "<<i<<" ";

     }

     else
     {
         while(even.size()%odd.size())
            {
             odd.push_back(even.back());
             odd.push_back(even.back());
         cnt1+=2;
         cnt2--;
            even.pop_back();
           }

         int t=cnt2/cnt1;
         cout<<odd.size()<<endl;
         for(int j=1;j<=cnt1;j++)
         {
         string tmp;
         for (int i=0;i<t;i++)tmp+=even[i];
         tmp+=odd[0];
         for (int i=t-1;i>=0;i--)tmp+=even[i];
         cout<<tmp<<" ";
         odd.erase(odd.begin());
         for (int i=1;i<=t;i++)even.erase(even.begin());
       //  cout<<"J:" << j<<endl;
         }
     }

}


#include"bits/stdc++.h"
using namespace std;

map<char,int >mp;
int main()
{
     int n;cin>>n;
     string k;cin>>k;
     set<char>s;
     for (int i=0;i<n;i++)
     {
         s.insert(k[i]);
         mp[k[i]]++;
     }
     vector<char>odd,even;
     int cnt1=0,cnt2=0;
     for(auto i:s)
     {
         if(mp[i]%2==0)
         {
             cnt2+=mp[i]/2;
             for (int u=1;u<=mp[i]/2;u++) even.push_back(i);
         }else
         {
             cnt1++,odd.push_back(i);
             if(mp[i]>2)
                 for (int u=1;u<=mp[i]/2;u++)
                  even.push_back(i);
             cnt2+=mp[i]/2;
         }
     }

    // cout<<cnt1<<" "<<cnt2<<endl;

     if(cnt2==0)
     {
         for(auto i:odd)cout<<i<<" ";
     }
     else if(cnt1==0)
     {
         for (int i=0;i<cnt2;i++)cout<<even[i];
         for(int i=cnt2-2;i>=0;i--)cout<<even[i];
     }
     else if(cnt2%cnt1==0)
     {
         int t=cnt2/cnt1;
         for(int j=1;j<=cnt1;j++)
         {
         string tmp;
         for (int i=0;i<t;i++)tmp+=even[i];
         tmp+=odd[0];
         for (int i=t-1;i>=0;i--)tmp+=even[i];
         cout<<tmp<<" ";
         odd.erase(odd.begin());
         for (int i=1;i<=t;i++)even.erase(even.begin());
       //  cout<<"J:" << j<<endl;
         }
     }
     else
     {
         for(auto i:odd)cout<<i<<" ";
         for (auto i:even)cout<<i<<" "<<i<<" ";

     }

}


#include"bits/stdc++.h"
using namespace std;

map<char,int >mp;
int main()
{
     int n;cin>>n;
     string k;cin>>k;
     set<char>s;
     for (int i=0;i<n;i++)
     {
         s.insert(k[i]);
         mp[k[i]]++;
     }
     vector<char>odd,even;
     int cnt1=0,cnt2=0;
     for(auto i:s)
     {
         if(mp[i]%2==0)
         {
             cnt2+=mp[i]/2;
             for (int u=1;u<=mp[i]/2;u++) even.push_back(i);
         }else
         {
             cnt1++,odd.push_back(i);
             if(mp[i]>2)
                 for (int u=1;u<=mp[i]/2;u++)
                  even.push_back(i);
             cnt2+=mp[i]/2;
         }
     }

    // cout<<cnt1<<" "<<cnt2<<endl;

     if(cnt2==0)
     {
       cout<<odd.size()<<endl;
         for(auto i:odd)cout<<i<<" ";
     }
     else if(cnt1==0)
     {
         cout<<1<<endl;
         for (int i=0;i<cnt2;i++)cout<<even[i];
         for(int i=cnt2-1;i>=0;i--)cout<<even[i];
     }
     else if(cnt2%cnt1==0)
     {
         int t=cnt2/cnt1;
         cout<<odd.size()<<endl;
         for(int j=1;j<=cnt1;j++)
         {
         string tmp;
         for (int i=0;i<t;i++)tmp+=even[i];
         tmp+=odd[0];
         for (int i=t-1;i>=0;i--)tmp+=even[i];
         cout<<tmp<<" ";
         odd.erase(odd.begin());
         for (int i=1;i<=t;i++)even.erase(even.begin());
       //  cout<<"J:" << j<<endl;
         }
     }
     else
     {
        cout<<odd.size() + even.size()*2 <<endl;
        for(auto i:odd)cout<<i<<" ";
         for (auto i:even)cout<<i<<" "<<i<<" ";

     }

}


#include"bits/stdc++.h"
using namespace std;

map<char,int >mp;
int main()
{
     int n;cin>>n;
     string k;cin>>k;
     set<char>s;
     for (int i=0;i<n;i++)
     {
         s.insert(k[i]);
         mp[k[i]]++;
     }
     vector<char>odd,even;
     int cnt1=0,cnt2=0;
     for(auto i:s)
     {
         if(mp[i]%2==0)
         {
             cnt2+=mp[i]/2;
             for (int u=1;u<=mp[i]/2;u++) even.push_back(i);
         }else
         {
             cnt1++,odd.push_back(i);
             if(mp[i]>2)
                 for (int u=1;u<=mp[i]/2;u++)
                  even.push_back(i);
             cnt2+=mp[i]/2;
         }
     }

    // cout<<cnt1<<" "<<cnt2<<endl;

     if(cnt2==0)
     {
       cout<<odd.size()<<endl;
         for(auto i:odd)cout<<i<<" ";
     }
     else if(cnt1==0)
     {
         cout<<1<<endl;
         for (int i=0;i<cnt2;i++)cout<<even[i];
         for(int i=cnt2-2;i>=0;i--)cout<<even[i];
     }
     else if(cnt2%cnt1==0)
     {
         int t=cnt2/cnt1;
         cout<<odd.size()<<endl;
         for(int j=1;j<=cnt1;j++)
         {
         string tmp;
         for (int i=0;i<t;i++)tmp+=even[i];
         tmp+=odd[0];
         for (int i=t-1;i>=0;i--)tmp+=even[i];
         cout<<tmp<<" ";
         odd.erase(odd.begin());
         for (int i=1;i<=t;i++)even.erase(even.begin());
       //  cout<<"J:" << j<<endl;
         }
     }
     else
     {
        cout<<odd.size() + even.size()*2 <<endl;
        for(auto i:odd)cout<<i<<" ";
         for (auto i:even)cout<<i<<" "<<i<<" ";

     }

}


#include <cstdio>
#include <cstring>
#include <string>
#include <string.h>
#include <cmath>
#include <iostream>
#include <cmath>
#include <algorithm>
#include <set>
#include <vector>
#include <map>

#define INF 0x3f3f3f3f
const int N = 100007;
using namespace std;
typedef long long ll;

char p[100001], s1[100001];

int a[128] = { 0 };

set<string> st;
string s;
vector<char> odd;
vector<char> even;

int main()
{
	int n, m, t, i, j, k;
	cin >> n >> s;
	for (i = 0; i < n; i++)
		a[s[i]]++;
	for (i = 0; i < 128; i++)
	{
		if (a[i] != 0)
		{
			if (a[i] % 2 == 1)
			{
				a[i]--;
				odd.push_back(i);
			}

			for (;;)
			{
				if (a[i] <= 0)
					break;
				a[i] -= 2;
				even.push_back(i);
			}
		}
	}
	if (odd.size())
	{
		if (odd.size() > even.size())
		{
			cout << n << endl;
			int temp = 0;
			for (i = 0; i < n; i++)
			{
				if (temp++)
					cout << ' ';
				cout << s[i];
			}
			cout << endl;
		}
		else if (odd.size() == even.size())
		{
			int temp = 1;
			cout << odd.size() << endl;
			for (i = 0; i < odd.size(); i++)
			{
				if (temp)
				{
					cout << even[i] << odd[i] << even[i];
					temp = 0;
				}
				else
					cout << ' ' << even[i] << odd[i] << even[i];
			}
			cout << endl;
		}
		else if (odd.size() < even.size())
		{
			int temp = 1, k = 0;
			m = even.size() / odd.size();
			int x, y, num = 0;
			x = even.size(), y = odd.size();
			while (x%y != 0)
			{
				num++;
				--x, y += 2;
			}
			j = 1;
			for (i = 0; i < num; i++)
			{
				odd.push_back(even[even.size() - 1]);
				odd.push_back(even[even.size() - 1]);
				even.pop_back();
			}
			m = odd.size() / 2;
			for (i = 0; i < odd.size(); i++)
			{
				if (temp)
				{
					temp = 0;
					for (j = k; j < k + m; j++)
						cout << even[i];
					cout << odd[i];
					for (j = k + m - 1; j >= 0; j--)
						cout << even[i];
					k += m;
				}
				else
				{
					cout << ' ';
					temp = 0;
					for (j = k; j < k + m; j++)
						cout << even[i];
					cout << odd[i];
					for (j = k + m - 1; j >= k; j--)
						cout << even[i];
					k += m;
				}
			}
			cout << endl;
		}
	}
	else
	{
		for (i = 0; i < n / 2; i++)
		{
			p[i] = even.back();
			p[n - i - 1] = even.back();
			even.pop_back();
		}
		p[n] = '\0';
		cout << 1 << endl << p << endl;
	}
	odd.clear();
	even.clear();
	return 0;
}


#include <cstdio>
#include <cstring>
#include <string>
#include <string.h>
#include <cmath>
#include <iostream>
#include <cmath>
#include <algorithm>
#include <set>
#include <vector>
#include <map>

#define INF 0x3f3f3f3f
const int N = 100007;
using namespace std;
typedef long long ll;

char p[100001], s1[100001];

int a[128] = { 0 };

set<string> st;
string s;
vector<char> odd;
vector<char> even;

int main()
{
	int n, m, t, i, j, k;
	cin >> n >> s;
	for (i = 0; i < n; i++)
		a[s[i]]++;
	for (i = 0; i < 128; i++)
	{
		if (a[i] != 0)
		{
			if (a[i] % 2 == 1)
			{
				a[i]--;
				odd.push_back(i);
			}

			for (;;)
			{
				if (a[i] <= 0)
					break;
				a[i] -= 2;
				even.push_back(i);
			}
		}
	}
	if (odd.size())
	{
		if (odd.size() > even.size())
		{
			cout << n << endl;
			int temp = 0;
			for (i = 0; i < n; i++)
			{
				if (temp++)
					cout << ' ';
				cout << s[i];
			}
			cout << endl;
		}
		else if (odd.size() == even.size())
		{
			int temp = 1;
			cout << odd.size() << endl;
			for (i = 0; i < odd.size(); i++)
			{
				if (temp)
				{
					cout << even[i] << odd[i] << even[i];
					temp = 0;
				}
				else
					cout << ' ' << even[i] << odd[i] << even[i];
			}
			cout << endl;
		}
		else if (odd.size() < even.size())
		{
			int temp = 1, k = 0;
			m = even.size() / odd.size();
			int x, y, num = 0;
			x = even.size(), y = odd.size();
			while (x%y != 0)
			{
				num++;
				--x, y += 2;
			}
			j = 1;
			for (i = 0; i < num; i++)
			{
				odd.push_back(even[even.size() - 1]);
				odd.push_back(even[even.size() - 1]);
				even.pop_back();
			}
			cout << odd.size() << endl;
			m = even.size() / odd.size();
			for (i = 0; i < odd.size(); i++)
			{
				if (temp)
				{
					temp = 0;
					for (j = k; j < k + m; j++)
						cout << even[j];
					cout << odd[i];
					for (j = k + m - 1; j >= 0; j--)
						cout << even[j];
					k += m;
				}
				else
				{
					cout << ' ';
					temp = 0;
					for (j = k; j < k + m; j++)
						cout << even[j];
					cout << odd[i];
					for (j = k + m - 1; j >= k; j--)
						cout << even[j];
					k += m;
				}
			}
			cout << endl;
		}
	}
	else
	{
		for (i = 0; i < n / 2; i++)
		{
			p[i] = even.back();
			p[n - i - 1] = even.back();
			even.pop_back();
		}
		p[n] = '\0';
		cout << 1 << endl << p << endl;
	}
	odd.clear();
	even.clear();
	return 0;
}


#include <cstdio>
#include <cstring>
#include <string>
#include <string.h>
#include <cmath>
#include <iostream>
#include <cmath>
#include <algorithm>
#include <set>
#include <vector>
#include <map>

#define INF 0x3f3f3f3f
const int N = 100007;
using namespace std;
typedef long long ll;

char p[500001], s1[500001];

int a[128] = { 0 };

set<string> st;
string s;
vector<char> odd;
vector<char> even;

int main()
{
	int n, m, t, i, j, k;
	cin >> n >> s;
	for (i = 0; i < n; i++)
		a[s[i]]++;
	for (i = 0; i < 128; i++)
	{
		if (a[i] != 0)
		{
			if (a[i] % 2 == 1)
			{
				a[i]--;
				odd.push_back(i);
			}

			for (;;)
			{
				if (a[i] <= 0)
					break;
				a[i] -= 2;
				even.push_back(i);
			}
		}
	}
	if (odd.size())
	{
		if (odd.size() > even.size())
		{
			cout << n << endl;
			int temp = 0;
			for (i = 0; i < n; i++)
			{
				if (temp++)
					cout << ' ';
				cout << s[i];
			}
			cout << endl;
		}
		else if (odd.size() == even.size())
		{
			int temp = 1;
			cout << odd.size() << endl;
			for (i = 0; i < odd.size(); i++)
			{
				if (temp)
				{
					cout << even[i] << odd[i] << even[i];
					temp = 0;
				}
				else
					cout << ' ' << even[i] << odd[i] << even[i];
			}
			cout << endl;
		}
		else if (odd.size() < even.size())
		{
			int temp = 1, k = 0;
			m = even.size() / odd.size();
			int x, y, num = 0;
			x = even.size(), y = odd.size();
			while (x%y != 0)
			{
				num++;
				--x, y += 2;
			}
			j = 1;
			for (i = 0; i < num; i++)
			{
				odd.push_back(even[even.size() - 1]);
				odd.push_back(even[even.size() - 1]);
				even.pop_back();
			}
			cout << odd.size() << endl;
			m = even.size() / odd.size();
			for (i = 0; i < odd.size(); i++)
			{
				if (temp)
				{
					temp = 0;
					for (j = k; j < k + m; j++)
						cout << even[j];
					cout << odd[i];
					for (j = k + m - 1; j >= 0; j--)
						cout << even[j];
					k += m;
				}
				else
				{
					cout << ' ';
					temp = 0;
					for (j = k; j < k + m; j++)
						cout << even[j];
					cout << odd[i];
					for (j = k + m - 1; j >= k; j--)
						cout << even[j];
					k += m;
				}
			}
			cout << endl;
		}
	}
	else
	{
		for (i = 0; i < n / 2; i++)
		{
			p[i] = even.back();
			p[n - i - 1] = even.back();
			even.pop_back();
		}
		p[n] = '\0';
		cout << 1 << endl << p << endl;
	}
	odd.clear();
	even.clear();
	return 0;
}


#include <cstdio>
#include <cstring>
#include <string>
#include <string.h>
#include <cmath>
#include <iostream>
#include <cmath>
#include <algorithm>
#include <set>
#include <vector>
#include <map>

#define INF 0x3f3f3f3f
const int N = 100007;
using namespace std;
typedef long long ll;

char p[100001], s1[100001];

int a[128] = { 0 };

set<string> st;
string s;
vector<char> odd;
vector<char> even;

int main()
{
	int n, m, t, i, j, k;
	cin >> n >> s;
	for (i = 0; i < n; i++)
		a[s[i]]++;
	for (i = 0; i < 128; i++)
	{
		if (a[i] != 0)
		{
			if (a[i] % 2 == 1)
			{
				a[i]--;
				odd.push_back(i);
			}

			for (;;)
			{
				if (a[i] <= 0)
					break;
				a[i] -= 2;
				even.push_back(i);
			}
		}
	}
	if (odd.size())
	{
		if (odd.size() > even.size())
		{
			cout << n << endl;
			int temp = 0;
			for (i = 0; i < n; i++)
			{
				if (temp++)
					cout << ' ';
				cout << s[i];
			}
			cout << endl;
		}
		else if (odd.size() == even.size())
		{
			int temp = 1;
			cout << odd.size() << endl;
			for (i = 0; i < odd.size(); i++)
			{
				if (temp)
				{
					cout << even[i] << odd[i] << even[i];
					temp = 0;
				}
				else
					cout << ' ' << even[i] << odd[i] << even[i];
			}
			cout << endl;
		}
		else if (odd.size() < even.size())
		{
			if (even.size() % odd.size())
			{
				cout << n << endl;
				int temp = 0;
				for (i = 0; i < n; i++)
				{
					if (temp++)
						cout << ' ';
					cout << s[i];
				}
				cout << endl;
			}
			else
			{
				int temp = 1, k = 0;
				m = even.size() / odd.size();
				for (i = 0; i < odd.size(); i++)
				{
					if (temp)
					{
						temp = 0;
						for (j = k; j < k + m; j++)
							cout << even[i];
						cout << odd[i];
						for (j = k + m - 1; j >= 0; j--)
							cout << even[i];
						k += m;
					}
					else
					{
						cout << ' ';
						temp = 0;
						for (j = k; j < k + m; j++)
							cout << even[i];
						cout << odd[i];
						for (j = k + m - 1; j >= 0; j--)
							cout << even[i];
						k += m;
					}
				}
				cout << endl;
			}
		}
	}
	else
	{
		for (i = 0; i < n / 2; i++)
		{
			p[i] = even.back();
			p[n - i - 1] = even.back();
			even.pop_back();
		}
		p[n] = '\0';
		cout << 1 << endl << p << endl;
	}
	odd.clear();
	even.clear();
	return 0;
}


#include <cstdio>
#include <cstring>
#include <string>
#include <string.h>
#include <cmath>
#include <iostream>
#include <cmath>
#include <algorithm>
#include <set>
#include <vector>
#include <map>

#define INF 0x3f3f3f3f
const int N = 100007;
using namespace std;
typedef long long ll;

char p[100001], s1[100001];

int a[128] = { 0 };

set<string> st;
string s;
vector<char> odd;
vector<char> even;

int main()
{
	int n, m, t, i, j, k;
	cin >> n >> s;
	for (i = 0; i < n; i++)
		a[s[i]]++;
	for (i = 0; i < 128; i++)
	{
		if (a[i] != 0)
		{
			if (a[i] % 2 == 1)
			{
				a[i]--;
				odd.push_back(i);
			}

			for (;;)
			{
				if (a[i] <= 0)
					break;
				a[i] -= 2;
				even.push_back(i);
			}
		}
	}
	if (odd.size())
	{
		if (odd.size() > even.size())
		{
			cout << n << endl;
			int temp = 0;
			for (i = 0; i < n; i++)
			{
				if (temp++)
					cout << ' ';
				cout << s[i];
			}
			cout << endl;
		}
		else if (odd.size() == even.size())
		{
			int temp = 1;
			cout << odd.size() << endl;
			for (i = 0; i < odd.size(); i++)
			{
				if (temp)
				{
					cout << even[i] << odd[i] << even[i];
					temp = 0;
				}
				else
					cout << ' ' << even[i] << odd[i] << even[i];
			}
			cout << endl;
		}
		else if (odd.size() < even.size())
		{
			int temp = 1, k = 0;
			m = even.size() / odd.size();
			int x, y, num = 0;
			x = even.size(), y = odd.size();
			while (x%y != 0)
			{
				num++;
				--x, y += 2;
			}
			j = 1;
			for (i = 0; i < num; i++)
			{
				odd.push_back(even[even.size() - 1]);
				odd.push_back(even[even.size() - 1]);
				even.pop_back();
			}
			cout << odd.size() << endl;
			m = odd.size() / 2;
			for (i = 0; i < odd.size(); i++)
			{
				if (temp)
				{
					temp = 0;
					for (j = k; j < k + m; j++)
						cout << even[i];
					cout << odd[i];
					for (j = k + m - 1; j >= 0; j--)
						cout << even[i];
					k += m;
				}
				else
				{
					cout << ' ';
					temp = 0;
					for (j = k; j < k + m; j++)
						cout << even[i];
					cout << odd[i];
					for (j = k + m - 1; j >= k; j--)
						cout << even[i];
					k += m;
				}
			}
			cout << endl;
		}
	}
	else
	{
		for (i = 0; i < n / 2; i++)
		{
			p[i] = even.back();
			p[n - i - 1] = even.back();
			even.pop_back();
		}
		p[n] = '\0';
		cout << 1 << endl << p << endl;
	}
	odd.clear();
	even.clear();
	return 0;
}


#include <iostream>
#include <cstdio>
#include <sstream>
#include <algorithm>
#include <iomanip>
#include <cmath>
#include <ctime>
#include <cstdlib>
#include <set>
#include <map>
#include <vector>
#include <queue>
#include <iterator>

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

#define x0 abc
#define y0 ABC
#define x1 abcd
#define y1 ABCD
#define xn abcde
#define yn ABCDE

#define l_b lower_bound
#define u_b upper_bound

#define in insert
#define er erase

#define fi first
#define se second
#define m_p make_pair

#define p_b push_back
#define po_b pop_back

#define uns unsigned

#define ld long double
#define ll long long

#define cont continue
#define re return

#define MAXLL 9000000000000000000LL
#define MAXINT 2000000000

#define MINLL -9000000000000000000LL
#define MININT -2000000000

#define pi acos(-1.)

#define endl '\n'

#define OUT cout << "-------" << endl;

using namespace std;

using namespace __gnu_pbds;

typedef tree <int, null_type, less <int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;

vector <char> v;

string s, s1;

char c[181];

int p[181], n, i, j, z, k, k1;

int main()
{
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);

    ios::sync_with_stdio(0);
    cin.tie(0);

    cin >> n;

    cin >> s;

    for (i = 0; i < n; i++)
        if (isdigit(s[i])) p[s[i] - 48]++;
        else if (islower(s[i])) p[s[i] - 96 + 9]++;
        else p[s[i] - 64 + 9 + 26]++;

    for (i = 0; i <= 9; i++) c[i] = char(i + 48);

    for (i = 9 + 1; i <= 9 + 26; i++) c[i] = char(i - 9 + 96);

    for (i = 9 + 26 + 1; i <= 9 + 26 + 26; i++) c[i] = char(i - 9 - 26 + 64);

    for (i = 0; i <= 100; i++) {
        k += p[i] % 2;

        if (p[i] % 2 != 0) {
            v.p_b(c[i]);

            p[i]--;
        }
    }

    if (k == 0) {
        cout << "1" << endl;

        for (i = 0; i <= 100; i++)
            for (j = 1; j <= p[i] / 2; j++) s1 += c[i];

        for (i = 100; i >= 0; i--)
            for (j = 1; j <= p[i] / 2; j++) s1 += c[i];

        cout << s1 << endl;

        re 0;
    }

    for (i = k; i <= n; i++)
        if (n % i == 0 && n / i % 2 != 0 && (i - k) % 2 == 0) {
            k1 = i;

            break;
        }

    cout << k1 << endl;

    for (i = 0; i <= 100; i++)
        for (j = 1; j <= p[i]; j++) {
            if (v.size() < k1)
            v.p_b(c[i]);
        }

    for (z = 0; z < v.size(); z++) {
        s1 = "";

        for (i = 0; i <= 100; i++) {
            while (p[i] - 2 >= 0) {
                if (s1.size() == n / k1 / 2)
                break;

                s1 += c[i];

                p[i] -= 2;

                if (s1.size() == n / k1 / 2)
                break;
            }
        }

        cout << s1;

        cout << v[z];

        reverse(s1.begin(), s1.end());

        cout << s1 << " ";
    }

    cout << endl;

    re 0;
}


#include <iostream>
#include <cstdio>
#include <sstream>
#include <algorithm>
#include <iomanip>
#include <cmath>
#include <ctime>
#include <cstdlib>
#include <set>
#include <map>
#include <vector>
#include <queue>
#include <iterator>

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

#define x0 abc
#define y0 ABC
#define x1 abcd
#define y1 ABCD
#define xn abcde
#define yn ABCDE

#define l_b lower_bound
#define u_b upper_bound

#define in insert
#define er erase

#define fi first
#define se second
#define m_p make_pair

#define p_b push_back
#define po_b pop_back

#define uns unsigned

#define ld long double
#define ll long long

#define cont continue
#define re return

#define MAXLL 9000000000000000000LL
#define MAXINT 2000000000

#define MINLL -9000000000000000000LL
#define MININT -2000000000

#define pi acos(-1.)

#define endl '\n'

#define OUT cout << "-------" << endl;

using namespace std;

using namespace __gnu_pbds;

typedef tree <int, null_type, less <int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;

vector <char> v;

string s, s1;

char c[181];

int p[181], n, i, j, z, k, k1;

int main()
{
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);

    ios::sync_with_stdio(0);
    cin.tie(0);

    cin >> n;

    cin >> s;

    for (i = 0; i < n; i++)
        if (isdigit(s[i])) p[s[i] - 48]++;
        else if (islower(s[i])) p[s[i] - 96 + 9]++;
        else p[s[i] - 64 + 9 + 26]++;

    for (i = 0; i <= 9; i++) c[i] = char(i + 48);

    for (i = 9 + 1; i <= 9 + 26; i++) c[i] = char(i - 9 + 96);

    for (i = 9 + 26 + 1; i <= 9 + 26 + 26; i++) c[i] = char(i - 9 - 26 + 64);

    for (i = 0; i <= 100; i++) {
        k += p[i] % 2;

        if (p[i] % 2 != 0) {
            v.p_b(c[i]);

            p[i]--;
        }
    }

    if (k == 0) {
        cout << "1" << endl;

        for (i = 0; i <= 100; i++)
            for (j = 1; j <= p[i] / 2; j++) s1 += c[i];

        for (i = 100; i >= 0; i--)
            for (j = 1; j <= p[i] / 2; j++) s1 += c[i];

        cout << s1 << endl;

        re 0;
    }

    for (i = k; i <= n; i++)
        if (n % i == 0 && (i - k) % 2 == 0) {
            k1 = i;

            break;
        }

    cout << k1 << endl;

    for (i = 0; i <= 100; i++)
        for (j = 1; j <= p[i]; j++) {
            if (v.size() < k1)
            v.p_b(c[i]);
        }

    for (z = 0; z < v.size(); z++) {
        s1 = "";

        for (i = 0; i <= 100; i++) {
            while (p[i] - 2 >= 0) {
                if (s1.size() == n / k1 / 2)
                break;

                s1 += c[i];

                p[i] -= 2;

                if (s1.size() == n / k1 / 2)
                break;
            }
        }

        cout << s1;

        cout << v[z];

        reverse(s1.begin(), s1.end());

        cout << s1 << " ";
    }

    cout << endl;

    re 0;
}


#include <iostream>
#include <cstdio>
#include <sstream>
#include <algorithm>
#include <iomanip>
#include <cmath>
#include <ctime>
#include <cstdlib>
#include <set>
#include <map>
#include <vector>
#include <queue>
#include <iterator>

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

#define x0 abc
#define y0 ABC
#define x1 abcd
#define y1 ABCD
#define xn abcde
#define yn ABCDE

#define l_b lower_bound
#define u_b upper_bound

#define in insert
#define er erase

#define fi first
#define se second
#define m_p make_pair

#define p_b push_back
#define po_b pop_back

#define uns unsigned

#define ld long double
#define ll long long

#define cont continue
#define re return

#define MAXLL 9000000000000000000LL
#define MAXINT 2000000000

#define MINLL -9000000000000000000LL
#define MININT -2000000000

#define pi acos(-1.)

#define endl '\n'

#define OUT cout << "-------" << endl;

using namespace std;

using namespace __gnu_pbds;

typedef tree <int, null_type, less <int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;

vector <char> v;

string s, s1;

char c[181];

int p[181], n, i, j, z, k, k1;

int main()
{
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);

    ios::sync_with_stdio(0);
    cin.tie(0);

    cin >> n;

    cin >> s;

    for (i = 0; i < n; i++)
        if (isdigit(s[i])) p[s[i] - 48]++;
        else if (islower(s[i])) p[s[i] - 96 + 9]++;
        else p[s[i] - 64 + 9 + 26]++;

    for (i = 0; i <= 9; i++) c[i] = char(i + 48);

    for (i = 9 + 1; i <= 9 + 26; i++) c[i] = char(i - 9 + 96);

    for (i = 9 + 26 + 1; i <= 9 + 26 + 26; i++) c[i] = char(i - 9 - 26 + 64);

    for (i = 0; i <= 100; i++) {
        k += p[i] % 2;

        if (p[i] % 2 != 0) {
            v.p_b(c[i]);

            p[i]--;
        }
    }

    if (k == 0) {
        cout << "1" << endl;

        for (i = 0; i <= 100; i++)
            for (j = 1; j <= p[i] / 2; j++) s1 += c[i];

        for (i = 100; i >= 0; i--)
            for (j = 1; j <= p[i] / 2; j++) s1 += c[i];

        cout << s1 << endl;

        re 0;
    }

    for (i = k; i <= n; i++)
        if (n % i == 0 && n / i % 2 != 0 && (i - k) % 2 == 0) {
            k1 = i;

            break;
        }

    cout << k1 << endl;

    for (i = 0; i <= 100; i++) {
        while (p[i] - 1 >= 0) {
            if (v.size() < k1) {
                v.p_b(c[i]);

                p[i]--;
            }
            else break;
        }
    }

    for (z = 0; z < v.size(); z++) {
        s1 = "";

        for (i = 0; i <= 100; i++) {
            while (p[i] - 2 >= 0) {
                if (s1.size() == n / k1 / 2)
                break;

                s1 += c[i];

                p[i] -= 2;

                if (s1.size() == n / k1 / 2)
                break;
            }
        }

        cout << s1;

        cout << v[z];

        reverse(s1.begin(), s1.end());

        cout << s1 << " ";
    }

    cout << endl;

    re 0;
}


#include <bits/stdc++.h>
using namespace std;
#define In_The_Name_Of_Allah_The_Merciful ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define Alhamdulillah return 0;
typedef long long ll;
typedef long double ld;
#define debug(n) cerr << "[" << #n << " = " << n << "]" << '\n'
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define F_OR(i, a, b, s) for (int i = (a); ((s) > 0 ? i < (b) : i > (b)); i += (s))
#define F_OR1(e) F_OR(i, 0, e, 1)
#define F_OR2(i, e) F_OR(i, 0, e, 1)
#define F_OR3(i, b, e) F_OR(i, b, e, (b)<(e)?1:-1)
#define F_OR4(i, b, e, s) F_OR(i, b, e, s)
#define GET5(a, b, c, d, e, ...) e
#define F_ORC(...) GET5(__VA_ARGS__, F_OR4, F_OR3, F_OR2, F_OR1)
#define lp(...) F_ORC(__VA_ARGS__)(__VA_ARGS__)
#define each(a,x) for (auto& a: x)
#define pb push_back
#define ins insert
#define sz(v) (int) v.size()

template<class T> void UniqeVector(vector<T>& v) {
    sort(all(v)); v.erase(unique(all(v)),end(v)); }

// INPUT
template<class A> void re(complex<A>& c);
template<class A, class B> void re(pair<A,B>& p);
template<class A> void re(vector<A>& v);
template<class A, size_t SZ> void re(array<A,SZ>& a);

template<class T> void re(T& x) { cin >> x; }
void re(double & d) { string t; re(t); d = stod(t); }
void re(ld& d) { string t; re(t); d = stold(t); }
template<class H, class... T> void re(H& h, T&... t) { re(h); re(t...); }

template<class A> void re(complex<A>& c) { A a,b; re(a,b); c = {a,b}; }
template<class A, class B> void re(pair<A,B>& p) { re(p.f,p.s); }
template<class A> void re(vector<A>& x) { each(a,x) re(a); }
template<class A, size_t SZ> void re(array<A,SZ>& x) { each(a,x) re(a); }

// TO_STRING
#define ts to_string
string ts(char c) { return string(1,c); }
string ts(const char* s) { return (string)s; }
string ts(string s) { return s; }
string ts(bool b) {
    #ifdef LOCAL
        return b ? "true" : "false";
    #else
        return ts((int)b);
    #endif
}
template<class A> string ts(complex<A> c) {
    stringstream ss; ss << c; return ss.str(); }
string ts(vector<bool> v) {
    string res = "{"; lp(i,sz(v)) res += char('0'+v[i]);
    res += "}"; return res; }
template<size_t SZ> string ts(bitset<SZ> b) {
    string res = ""; lp(i,SZ) res += char('0'+b[i]);
    return res; }
template<class A, class B> string ts(pair<A,B> p);
template<class T> string ts(T v) { // containers with begin(), end()
    #ifdef LOCAL
        bool fst = 1; str res = "{";
        for (const auto& x: v) {
            if (!fst) res += ", ";
            fst = 0; res += ts(x);
        }
        res += "}"; return res;
    #else
        bool fst = 1; string res = "";
        for (const auto& x: v) {
            if (!fst) res += " ";
            fst = 0; res += ts(x);
        }
        return res;

    #endif
}
template<class A, class B> string ts(pair<A,B> p) {
    #ifdef LOCAL
        return "("+ts(p.f)+", "+ts(p.s)+")";
    #else
        return ts(p.f)+" "+ts(p.s);
    #endif
}

// OUTPUT
template<class A> void pr(A x) { cout << ts(x); }
template<class H, class... T> void pr(const H& h, const T&... t) {
    pr(h); pr(t...); }
void ps() { pr("\n"); } // print w/ spaces
template<class H, class... T> void ps(const H& h, const T&... t) {
    pr(h); if (sizeof...(t)) pr(" "); ps(t...); }
void prsz (vector <int> &v){
    pr(sz(v),'\n');
    pr(v);
}

const int di[8] = {0 , 0 , 1 , -1 , 1 , 1 , -1 , -1};
const int dj[8] = {1 , -1 , 0 , 0 , 1 , -1 , 1 , -1};

/***********************************************************/

const int SZ = 26*2+10;
vector <int> cnt (SZ);
int n;
string s;

void add (char c){

    if (isdigit(c))
        cnt[c-'0']++;
    if (isupper(c))
        cnt[c-'A'+10]++;
    if (islower(c))
        cnt[c-'a'+36]++;

}

char to_char (int c){

    if (c < 10)
        return char ('0'+c);
    c -= 10;
    if (c < 26)
        return char ('A'+c);
    c -= 26;
    return char ('a'+c);

}

void Try (int siz){

    vector <int> cnt2 = cnt;
    string middle = "";

    if (siz & 1){

        lp(SZ){
            if (cnt2[i] & 1){
                middle += to_char(i);
                cnt2[i]--;
            }
        }

        if (sz(middle) > n/siz)
            return;

        if (sz(middle) < n/siz){
            lp(SZ){
                int dif = n/siz - sz(middle);
                if (dif <= 0)
                    break;
                int need = min (cnt2[i],dif);
                cnt2[i] -= need;
                middle += string (need,to_char(i));
            }
        }

        if (sz(middle) > n/siz)
            return;
    }

    string to_add = "";

    lp(SZ){
        if (cnt2[i] & 1)
            return;
        to_add += string (cnt2[i]/2,to_char(i));
    }

    ps(n/siz);
    int i = 0 , j = 0;
    lp(k,n/siz){
        string ans (siz,'?');
        lp(t,siz/2){
            ans[t] = ans[siz-t-1] = to_add[i];
            ++i;
        }
        if (siz&1){
            ans[siz/2] = middle[j];
            ++j;
        }
        pr(ans,' ');
    }

    exit(0);
}

vector <int> divisors (int x){

    vector <int> ans;

    int sq = sqrt(x);
    for (int i = 1 ; i <= sq ; ++i){

        if (!(x%i)){

            if ( i*i == x)
                ans.push_back(i);

            else
                ans.push_back(i),
                ans.push_back(x/i);
        }
    }

    return ans;

}

void Suhaib_Sawalha (){

    re(n,s);
    each(x,s)
        add(x);

    vector <int> d = divisors(n);
    sort(rall(d));
    each(x,d)
        Try(x);
    // Try(1);
}

int main(){
                                In_The_Name_Of_Allah_The_Merciful   /* بسم الله الرحمن الرحيم  */
#ifndef ONLINE_JUDGE
    freopen("SuhaibSawalha1.txt","r",stdin);
#endif
// int _;cin>>_;for(int i=1;i<=_;++i)
        Suhaib_Sawalha();
                                         Alhamdulillah                    /* الحمد لله */
}


#include <bits/stdc++.h>
using namespace std;
#define In_The_Name_Of_Allah_The_Merciful ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define Alhamdulillah return 0;
typedef long long ll;
typedef long double ld;
#define debug(n) cerr << "[" << #n << " = " << n << "]" << '\n'
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define F_OR(i, a, b, s) for (int i = (a); ((s) > 0 ? i < (b) : i > (b)); i += (s))
#define F_OR1(e) F_OR(i, 0, e, 1)
#define F_OR2(i, e) F_OR(i, 0, e, 1)
#define F_OR3(i, b, e) F_OR(i, b, e, (b)<(e)?1:-1)
#define F_OR4(i, b, e, s) F_OR(i, b, e, s)
#define GET5(a, b, c, d, e, ...) e
#define F_ORC(...) GET5(__VA_ARGS__, F_OR4, F_OR3, F_OR2, F_OR1)
#define lp(...) F_ORC(__VA_ARGS__)(__VA_ARGS__)
#define each(a,x) for (auto& a: x)
#define pb push_back
#define ins insert
#define sz(v) (int) v.size()

template<class T> void UniqeVector(vector<T>& v) {
    sort(all(v)); v.erase(unique(all(v)),end(v)); }

// INPUT
template<class A> void re(complex<A>& c);
template<class A, class B> void re(pair<A,B>& p);
template<class A> void re(vector<A>& v);
template<class A, size_t SZ> void re(array<A,SZ>& a);

template<class T> void re(T& x) { cin >> x; }
void re(double & d) { string t; re(t); d = stod(t); }
void re(ld& d) { string t; re(t); d = stold(t); }
template<class H, class... T> void re(H& h, T&... t) { re(h); re(t...); }

template<class A> void re(complex<A>& c) { A a,b; re(a,b); c = {a,b}; }
template<class A, class B> void re(pair<A,B>& p) { re(p.f,p.s); }
template<class A> void re(vector<A>& x) { each(a,x) re(a); }
template<class A, size_t SZ> void re(array<A,SZ>& x) { each(a,x) re(a); }

// TO_STRING
#define ts to_string
string ts(char c) { return string(1,c); }
string ts(const char* s) { return (string)s; }
string ts(string s) { return s; }
string ts(bool b) {
    #ifdef LOCAL
        return b ? "true" : "false";
    #else
        return ts((int)b);
    #endif
}
template<class A> string ts(complex<A> c) {
    stringstream ss; ss << c; return ss.str(); }
string ts(vector<bool> v) {
    string res = "{"; lp(i,sz(v)) res += char('0'+v[i]);
    res += "}"; return res; }
template<size_t SZ> string ts(bitset<SZ> b) {
    string res = ""; lp(i,SZ) res += char('0'+b[i]);
    return res; }
template<class A, class B> string ts(pair<A,B> p);
template<class T> string ts(T v) { // containers with begin(), end()
    #ifdef LOCAL
        bool fst = 1; str res = "{";
        for (const auto& x: v) {
            if (!fst) res += ", ";
            fst = 0; res += ts(x);
        }
        res += "}"; return res;
    #else
        bool fst = 1; string res = "";
        for (const auto& x: v) {
            if (!fst) res += " ";
            fst = 0; res += ts(x);
        }
        return res;

    #endif
}
template<class A, class B> string ts(pair<A,B> p) {
    #ifdef LOCAL
        return "("+ts(p.f)+", "+ts(p.s)+")";
    #else
        return ts(p.f)+" "+ts(p.s);
    #endif
}

// OUTPUT
template<class A> void pr(A x) { cout << ts(x); }
template<class H, class... T> void pr(const H& h, const T&... t) {
    pr(h); pr(t...); }
void ps() { pr("\n"); } // print w/ spaces
template<class H, class... T> void ps(const H& h, const T&... t) {
    pr(h); if (sizeof...(t)) pr(" "); ps(t...); }
void prsz (vector <int> &v){
    pr(sz(v),'\n');
    pr(v);
}

const int di[8] = {0 , 0 , 1 , -1 , 1 , 1 , -1 , -1};
const int dj[8] = {1 , -1 , 0 , 0 , 1 , -1 , 1 , -1};

/***********************************************************/

const int SZ = 26*2+10;
vector <int> cnt (SZ);
int n;
string s;

void add (char c){

    if (isdigit(c))
        cnt[c-'0']++;
    if (isupper(c))
        cnt[c-'A'+10]++;
    if (islower(c))
        cnt[c-'a'+36]++;

}

char to_char (int c){

    if (c < 10)
        return char ('0'+c);
    c -= 10;
    if (c < 26)
        return char ('A'+c);
    c -= 26;
    return char ('a'+c);

}

void Try (int siz){

    vector <int> cnt2 = cnt;
    string middle = "";

    if (siz & 1){

        lp(SZ){
            if (cnt2[i] & 1){
                middle += to_char(i);
                cnt2[i]--;
            }
        }

        if (sz(middle) > n/siz)
            return;

        if (sz(middle) < n/siz){
            lp(SZ){
                int dif = sz(middle) - n/siz;
                if (dif <= 0)
                    break;
                int need = min (cnt2[i],dif);
                cnt2[i] -= need;
                middle += string (need,to_char(i));
            }
        }

        if (sz(middle) > n/siz)
            return;
    }

    string to_add = "";

    lp(SZ){
        if (cnt2[i] & 1)
            return;
        to_add += string (cnt2[i]/2,to_char(i));
    }

    ps(n/siz);
    int i = 0 , j = 0;
    lp(k,n/siz){
        string ans (siz,'?');
        lp(t,siz/2){
            ans[t] = ans[siz-t-1] = to_add[i];
            ++i;
        }
        if (siz&1){
            ans[siz/2] = middle[j];
            ++j;
        }
        pr(ans,' ');
    }

    exit(0);
}

void Suhaib_Sawalha (){

    re(n,s);
    each(x,s)
        add(x);

    int siz = n;
    while (siz){
        if (n % siz == 0)
            Try(siz);
        siz /= 2;
    }

}

int main(){
                                In_The_Name_Of_Allah_The_Merciful   /* بسم الله الرحمن الرحيم  */
#ifndef ONLINE_JUDGE
    freopen("SuhaibSawalha1.txt","r",stdin);
#endif
// int _;cin>>_;for(int i=1;i<=_;++i)
        Suhaib_Sawalha();
                                         Alhamdulillah                    /* الحمد لله */
}


/*
 Sarthak Jain
*/
#include <bits/stdc++.h>
using namespace std;
#define endl "\n"
#define int long long
int mod=1e9+7;
int min(int a,int b){
	return (a<b)?a:b;
}
int max(int a,int b){
	return (a>b)?a:b;
}
int fp(int a,int b){
	if(b==0) return 1;
	int x=fp(a,b/2);
	x=(x*x)%mod;
	if(b&1) x=(x*a)%mod;
	return x;
}

signed main() {
 ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);

 int n;
 cin>>n;
 string s;
 cin>>s;
 vector<int> v,mp(300);
 for(int i=1;i*i<=n;i++)
 {
 	if(n%i==0)
 	{
 		v.push_back(i);
 		if(i!=(n/i))
 		{
 			v.push_back(n/i);
 		}
 	}
 }
  for(auto i:s)
  	mp[i]++;
 sort(v.begin(),v.end());
 for(auto i:v)
 {
 	//i palindromic string
 	int tot=n;
 	if((n/i)&1)
 		tot-=i;
 	vector<array<int,2>> x;
 	vector<int> z;
 	for(int j=0;j<=255;j++)
 	{
 		if(mp[j]&1)
 		{
 				z.push_back(j);
 		}
 		if(tot>0)
 		{
 			int y=min(tot/2,mp[j]/2);
 			if(y==0)
 				continue;
 			tot-=min(tot/2,mp[j]/2)*2;
 			x.push_back({j,y});
 		}
 	}

 	//cout<<i<<" "<<tot<<endl;
 	if(tot==0)
 	{
 		int ct=0;
 		cout<<i<<endl;
 		while(++ct<=i)
 		{
 			string a,b;
 			while(a.size()<((n/i)/2))
 			{
 				a=a+char(x.back()[0]);
 				b=char(x.back()[0])+b;
 				x.back()[1]--;
 				if(x.back()[1]==0)
 				{
 					x.pop_back();
 				}
 			//	cout<<x.back()[0]<<" "<<x.back()[1]<<endl;
 				//break;
 			}
 			if((n/i)%2)
 			{
 				a=a+char(z.back());
 				z.pop_back();
 			}
 			cout<<a+b<<" ";
 			//break;

 		}
 		return 0;
 	}
 }

}


/*
 Sarthak Jain
*/
#include <bits/stdc++.h>
using namespace std;
#define endl "\n"
#define int long long
int mod=1e9+7;
int min(int a,int b){
	return (a<b)?a:b;
}
int max(int a,int b){
	return (a>b)?a:b;
}
int fp(int a,int b){
	if(b==0) return 1;
	int x=fp(a,b/2);
	x=(x*x)%mod;
	if(b&1) x=(x*a)%mod;
	return x;
}

signed main() {
 ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);

 int n;
 cin>>n;
 string s;
 cin>>s;
 vector<int> v,mp(300);
 for(int i=1;i*i<=n;i++)
 {
 	if(n%i==0)
 	{
 		v.push_back(i);
 		if(i!=(n/i))
 		{
 			v.push_back(n/i);
 		}
 	}
 }
  for(auto i:s)
  	mp[i]++;
 sort(v.begin(),v.end());
 for(auto i:v)
 {
 	//i palindromic string
 	int tot=n;
 	if((n/i)&1)
 		tot-=i;
 	vector<array<int,2>> x;
 	vector<int> z;
 	for(int j=0;j<=255;j++)
 	{
 		int y=min(tot/2,mp[j]/2);
 		int h=mp[j]-2*y;
 		while(h--)
 		{
// 				cout<<char(j)<<endl;
 				z.push_back(j);
 		}

 		if(tot>0)
 		{
 			if(y==0)
 				continue;
 			tot-=y*2;
 			x.push_back({j,y});
 			//cout<<char(j)<<" "<<y<<endl;

 		}
 	}
 	//cout<<endl;
 	//cout<<z.size()<<endl;
 	//cout<<i<<" "<<tot<<endl;
 	if(tot==0)
 	{
 		int ct=0;
 		cout<<i<<endl;
 		while(++ct<=i)
 		{
 			string a,b;
 			while(a.size()<((n/i)/2))
 			{
 				a=a+char(x.back()[0]);
 				b=char(x.back()[0])+b;
 				x.back()[1]--;
 				if(x.back()[1]==0)
 				{
 					x.pop_back();
 				}
 				//cout<<x.back()[0]<<" "<<x.back()[1]<<endl;
 			//	break;
 			}
 			 if((n/i)%2)
 			 {
 			 	a=a+char(z.back());
 			 	z.pop_back();
 			 }
 			cout<<a+b<<" ";
 			//break;

 		}
 		return 0;
 	}
 }

}


/*
 Sarthak Jain
*/
#include <bits/stdc++.h>
using namespace std;
#define endl "\n"
#define int long long
int mod=1e9+7;
int min(int a,int b){
	return (a<b)?a:b;
}
int max(int a,int b){
	return (a>b)?a:b;
}
int fp(int a,int b){
	if(b==0) return 1;
	int x=fp(a,b/2);
	x=(x*x)%mod;
	if(b&1) x=(x*a)%mod;
	return x;
}

signed main() {
 ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);

 int n;
 cin>>n;
 string s;
 cin>>s;
 vector<int> v,mp(300);
 for(int i=1;i*i<=n;i++)
 {
 	if(n%i==0)
 	{
 		v.push_back(i);
 		if(i!=(n/i))
 		{
 			v.push_back(n/i);
 		}
 	}
 }
  for(auto i:s)
  	mp[i]++;
 sort(v.begin(),v.end());
 for(auto i:v)
 {
 	//i palindromic string
 	int tot=n;
 	if((n/i)&1)
 		tot-=i;
 	vector<array<int,2>> x;
 	vector<int> z;
 	for(int j=48;j<='z';j++)
 	{
 		int y=min(tot/2,mp[j]/2);
 		int h=mp[j]-2*y;
 		while(h--)
 		{
 				z.push_back(j);
 		}

 		if(tot>0)
 		{
 			if(y==0)
 				continue;
 			tot-=y*2;
 			x.push_back({j,y});
 		}
 	}
 	if(tot==0)
 	{
 		int ct=0;
 		cout<<i<<endl;
 		while(++ct<=i)
 		{
 			vector<char> a,b;
 			while(a.size()<((n/i)/2))
 			{
 				a.push_back(char(x.back()[0]));
 				x.back()[1]--;
 				if(x.back()[1]==0)
 				{
 					x.pop_back();
 				}
 			}
 			for(auto j:a)
 				cout<<j;
 			reverse(a.begin(),a.end());
 			 if((n/i)%2)
 			 {
 			 	cout<<char(z.back());
 			 	z.pop_back();
 			 }
 			 for(auto i:a)
 			 	cout<<i;
 			cout<<" ";
 			//break;

 		}
 		return 0;
 	}
 }

}


#include <bits/stdc++.h>

using namespace std;

#define _ ios_base::sync_with_stdio(0);cin.tie(0);
#define endl '\n'
#define f first
#define s second
#define pb push_back

typedef long long ll;
typedef pair<int, int> ii;

const int INF = 0x3f3f3f3f;

int main(){ _
	int n; cin >> n;
	string s; cin >> s;

	map<char, int> mp;
	vector<char> back(100);
	int ptr = 0;
	vector<int> v(100);

	for(auto u : s){
		if(!mp.count(u)) mp[u]=ptr++;
		v[mp[u]]++;
		back[mp[u]] = u;
	}

	vector<int> div;
	for(int i=1; i*i<=n; i++) if(n%i==0){
		div.pb(i);
		if(i*i!=n) div.pb(n/i);
	}
	sort(div.begin(), div.end());

	int imp = 0;
	for(auto u : v) imp += u%2;

	int ans = 0;
	for(auto d : div){
		int sz = n/d;
		if(sz%2 and d%2!=imp%2) continue;
		if(sz%2==0 and imp) continue;
		ans = d;
		break;
	}

	int sz = n/ans;
	cout << ans << endl;
	for(int t=0;t <ans; t++){
		string at;
		int tot = sz/2;
		for(int i=0; i<ptr and tot; i++){
			if(v[i]>=2) v[i]-=2, at+=back[i], tot--;
		}
		string aux; aux = at;
		reverse(aux.begin(), aux.end());
		if(sz%2){
			if(imp){
				for(int i=0;i <ptr; i++) if(v[i]%2){at+=back[i], v[i]--; break;}
			}
			else{
				for(int i=0;i <ptr; i++) if(v[i]){at+=back[i], v[i]--; break;}
			}
		}
		at += aux;
		cout << at << " ";
	}
	cout << endl;

	exit(0);
}