#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#define MOD 10000000007
typedef unsigned long long int ull;
ull calc(ull i)
{    ull a ;
    if(i==0)return(1);
    else
    {
    a = calc(i/2)%MOD;
    if(i%2)
    return((a*a*2)%MOD);
    else return((a*a)%MOD);
    }
}
int main()
{
     ull n, a3;
    scanf("%I64u", &n);
    a3 = calc(n);
    a3 = (((a3/2)%MOD)*((a3+1)%MOD))%MOD;
    printf("%I64u", a3);
    return (0);
    }


#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#define MOD 10000000007
typedef unsigned long long int ull;
ull calc(ull i)
{    ull a ;
    if(i==0)return(1);
    else
    {
    a = calc(i/2)%MOD;
    if(i%2)
    return((a*a*2)%MOD);
    else return((a*a)%MOD);
    }
}
int main()
{
     ull n, a3;
    scanf("%I64u", &n);
    a3 = calc(n);
    a3 = ((a3/2)%MOD)*((a3+1)%MOD);
    printf("%I64u", a3);
    return (0);
    }


#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#define mod(a) (a%1000000007)
typedef unsigned long long int ull;
ull calc(ull i)
{    ull a ;
    if(i==0)return(1);
    else
    {
    a = mod(calc(i/2));
    printf("%I64u \n", a);
    if(i%2)
    return mod(a*a*2);
    else return mod(a*a);
    }
}
int main()
{
     ull n, a3;
    scanf("%I64u", &n);
    a3 = calc(n);
    a3 = mod((a3/2)*((a3+1)));
    printf("%I64u", a3);
    return (0);
    }


#include<stdio.h>
#include<stdlib.h>
long long fast_exp(int N)
   {
       return(0x01 << N);
   }
int main()
{
    long long int i,a1, a2, a3;
    scanf("%64Id", &i);
    a1 = fast_exp(i-1);
    a2 = fast_exp(i);
    a3 = a1(a2 - 1);
    printf("%64Id", a3);
    return (0);
    }


#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#define MOD 10000000007
typedef unsigned long long int ull;
ull calc(ull i)
{    ull a ;
    if(i==0)return(1);
    else
    {
    a = calc(i/2)%MOD;
    if(i%2)
    return((a*a*2)%MOD);
    else return((a*a)%MOD);
    }
}
int main()
{
     ull n, a3;
    scanf("%I64u", &n);
    a3 = calc(n);
    a3 = a3*(a3+1)/2;
    printf("%I64u", a3);
    return (0);
    }


#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#define mod(a) (a%1000000007)
typedef unsigned long long int ull;
ull calc(ull i)
{    ull a ;
    if(i==0)return(1);
    else
    {
    a = mod(calc(i/2));
    if(i%2)
    return mod(a*a*2);
    else return mod(a*a);
    }
}
int main()
{
     ull n, a3;
    scanf("%I64u", &n);

    a3 = calc(n);
    a3 = mod((a3)*(a3+1)/2);
    printf("%I64u", a3);
    return (0);
    }


#define MOD 1000000007
typedef unsigned long long int ULL;
int main()
{
    ULL n,d,b;
    scanf("%I64u",&n);
    d = 1;b=2;
    while(n>0)
    {
        if(n%2==1) d=(d*b)%MOD;
        n=n>>1;
        b=(b*b)%MOD;
    }
    d=((d*(d+1))/2)%MOD;
    printf("%I64u",d);
    return 0;
}


import java.util.Scanner;

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author Andy Phan
 */
public class p185a {
    static long MOD = 1000000007;

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        long a = in.nextLong();
        if(a == 0) System.out.println(1);
        else System.out.println(mult(new long[][] {{1, 0}}, expo(new long[][] {{3, 1}, {1, 3}}, a))[0][0]);
    }

    static long[][] mult(long[][] a, long[][] b) {
        long[][] res = new long[a.length][b[0].length];
        for(int i = 0; i < a.length; i++) {
            for(int j = 0; j < b[0].length; j++) {
                for(int k = 0; k < a[0].length; k++) {
                    res[i][j] = (res[i][j] + a[i][k]*b[k][j])%MOD;
                }
            }
        }
        return res;
    }

    static long[][] expo(long[][] base, long pow) {
        if(pow == 1) return base;
        long[][] tmp = expo(base, pow/2);
        tmp = mult(tmp, tmp);
        if(pow%2 == 1) tmp = mult(tmp, base);
        return tmp;
    }
}


import java.util.Scanner;

public class CF185A {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        long n = scanner.nextLong();
        //x[i]表示第i年向上的叶子数
        //y[i]表示第i年向下的叶子数
        //x[i] = x[i-1]*3 + y[i-1]
        //y[i] = y[i-1]*3 + x[i-1]
        //两个方程相减
        //x[i] - y[i] = 2x[i-1] - 2y[i-1] = 2^i
        //又知每年1个变4个,那么总数是4的i次方
        //x[i] + y[i] = 4^i
        //上面两个方程相加/2
        //x[i] = 2^(i-1) + 2^(2*i-1)
        long result = pow(2, n-1) + pow(2, 2*n-1);
        System.out.println(result%(1000000007));
    }

    //x的y次方，
    private static long pow(long x, long y){
        long r = 1;
        while(y > 0){
            if(y%2 == 1){
                r = r*x%(1000000007);
            }
            x = x*x%(1000000007);
            y = y/2;
        }
        return r;
    }
}


import java.util.Scanner;

public class CF185A {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        long n = scanner.nextLong();
        if(n == 1){
            System.out.println(3);
        }
        else{
            long result = Math.round(Math.pow(3,2)+n-1);
            System.out.println(result%(1000000007));
        }
    }
}


import java.util.Scanner;

public class CF185A {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        //x[i]表示第i年向上的叶子数
        //y[i]表示第i年向下的叶子数
        //x[i] = x[i-1]*3 + y[i-1]
        //y[i] = y[i-1]*3 + x[i-1]
        //两个方程相减
        //x[i] - y[i] = 2x[i-1] - 2y[i-1] = 2^i
        //又知每年1个变4个,那么总数是4的i次方
        //x[i] + y[i] = 4^i
        //上面两个方程相加/2
        //x[i] = 2^(i-1) + 2^(2*i-1)
        long result = pow(2, n-1) + pow(2, 2*n-1);
        System.out.println(result%(1000000007));
    }

    //x的y次方，
    private static long pow(long x, long y){
        long r = 1;
        while(y > 0){
            if(y%2 == 1){
                r = r*x%(1000000007);
            }
            x = x*x%(1000000007);
            y = y/2;
        }
        return r;
    }
}


import java.util.Scanner;

public class CF185A {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        long n = scanner.nextLong();
        if(n == 1){
            System.out.println(3);
        }
        else{
            System.out.println(Math.pow(3,2)+n-1);
        }
    }
}


#include "bits/stdc++.h"

using namespace std;
using LL = long long;

constexpr int N = 1e5 + 5;

map< char, int> mp;
vector< pair< char, int>> dat;

bool can(int n, int len) {
    int odd = 0;
    for (auto p : dat) {
        if (p.second & 1) odd++;
    }

    if (odd > n) return false;
    if (odd > 0 && len % 2 == 0) return false;
    return true;
}

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

    int n;
    cin >> n;

    string s;
    cin >> s;

    for (char c : s) mp[c]++;

    dat.assign(begin(mp), end(mp));

    int ans;

    for (int i = 1; i <= n; i++) {
        if (n % i == 0) {
            if (can(i, n / i)) {
                ans = i;
                break;
            }
        }
    }

    const int len = n / ans;
    cout << ans << endl;

    string even, odd;

    for (auto p : dat) {
        string z;

        while (p.second-- > 0) {
            z.push_back(p.first);
            if (z.size() == len) {
                cout << z << ' ';
                z.clear();
            }
        }

        if (!z.empty()) {
            if (z.size() & 1) {
                odd.push_back(z.back());
                z.pop_back();
            }
            if (!z.empty()) even += z;
        }
    }

    for (char c : odd) {
        string p;
        int d = len / 2;
        for (int i = 0; i < d; i++) {
            p.push_back(even.back());
            even.pop_back();
            even.pop_back();
        }

        cout << p << c;
        reverse(begin(p), end(p));
        cout << p << ' ';
    }

    for (int i = 0; i < (int) even.size(); i += len) {
        cout << even.substr(i, len) << ' ';
    }
}


#include "bits/stdc++.h"

using namespace std;
using LL = long long;

constexpr int N = 1e5 + 5;

map< char, int> mp;

bool possible(int n, int L) {
    int odd = 0;
    for (auto p : mp) if (p.second & 1) odd++;
    if (odd > n) return false;
    if (odd > 0 && L % 2 == 0) return false;
    return true;
}

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

    int n;
    string s;

    cin >> n >> s;

    for (char c : s) mp[c]++;

    int ans = -1;

    for (int i = 1; i <= n; i++) if (n % i == 0) {
            if (possible(i, n / i)) {
                ans = i;
                break;
            }
        }

    cout << ans << endl;
    const int len = n / ans;

    vector< string> work(ans, string(len, '*'));
    vector< char> odds;
    string extra;

    for (auto p : mp) {
        if (p.second & 1) {
            odds.push_back(p.first);
            p.second--;
        }
        extra += string(p.second, p.first);
    }

    for (int i = 0; i < (int) min(odds.size(), work.size()); i++) {
        work[i][len / 2] = odds[i];
    }

    for (auto& x : work) {
        for (int i = 0, j = len - 1; i < j; i++, j--) {
            x[i] = extra.back(); extra.pop_back();
            x[j] = extra.back(); extra.pop_back();
        }
    }

    for (auto& x : work) {
        if (x[len / 2] == '*') {
            x[len / 2] = extra.back();
            extra.pop_back();
        }
    }

    for (auto x : work) cout << x << ' ';
}


#include "bits/stdc++.h"

using namespace std;
using LL = long long;

constexpr int N = 1e5 + 5;

bool Palin(string x) {
    map< char, int> mp;

    for (char c : x) mp[c]++;
    int cnt = 0;
    for (auto p : mp) if (p.second & 1) cnt++;

    return (cnt <= 1);
}

string make_palin(string s) {
    map< char, int> mp;

    for (char c : s) mp[c]++;

    string p, odd;
    for (auto it : mp) {
        if (it.second % 2) {
            odd = string(it.second, it.first);
        }
        else {
            p += string(it.second / 2, it.first);
        }
    }

    auto rp = p;
    reverse(begin(rp), end(rp));
    return p + odd + rp;
}

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

    int n;
    cin >> n;

    string s;
    cin >> s;

    for (int len = n; len >= 1; len--) {
        if (n % len) continue;

        bool ok = true;

        for (int i = 0; i < n; i += len) {
            if (!Palin(s.substr(i, len))) {
                ok = false;
                break;
            }
        }

        if (ok) {
            cout << n / len << "\n";
            for (int i = 0; i < n; i += len) {
                cout << make_palin(s.substr(i, len)) << ' ';
            }
            return 0;
        }
    }
}


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

#define ll long long
#define endl "\n"

ll cnt[300];

int main(){
	ios_base::sync_with_stdio(false);

	ll n;
	cin>>n;
	string s;
	cin>>s;
	ll even=0;
	for(char c:s){
		ll num=c-'0';
		cnt[num]++;
	}
	for(ll i=0;i<=80;i++){
		even+=(cnt[i]/2);
	}
	vector<ll>d;
	for(ll i=n;i>0;i--){
		if(n%i==0){
			d.push_back(i);
		}
	}
	for(ll sz:d){
		ll item=n/sz;
		ll half=sz/2;
		if(even>=half*item){
			cout<<item<<endl;
			vector<string>res;
			for(ll i=0;i<item;i++){
				string ans;
				for(ll j=0;j<half;j++){
					for(ll k=0;k<=80;k++){
						if(cnt[k]>=2){
							cnt[k]-=2;
							char c=k+'0';
							ans+=c;
							break;
						}
					}
				}
				res.push_back(ans);
			}
			for(string ans:res){
				char c;
				if(sz&1){
					for(ll j=0;j<=80;j++){
						if(cnt[j]>=1){
							cnt[j]--;
							c=j+'0';
							break;
						}
					}
				}
				cout<<ans;
				if(sz&1) cout<<c;
				reverse(ans.begin(),ans.end());
				cout<<ans<<" ";
			}
			cout<<endl;
			return 0;
		}
	}
}


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

#define ll long long
#define endl "\n"

ll cnt[300];

int main(){
	ios_base::sync_with_stdio(false);

	ll n;
	cin>>n;
	string s;
	cin>>s;
	ll even=0;
	for(char c:s){
		ll num=c-'0';
		cnt[num]++;
	}
	for(ll i=0;i<=75;i++){
		even+=(cnt[i]/2);
	}
	vector<ll>d;
	for(ll i=n;i>0;i--){
		if(n%i==0){
			d.push_back(i);
		}
	}
	for(ll sz:d){
		ll item=n/sz;
		ll half=sz/2;
		if(even>=half*item){
			cout<<item<<endl;
			vector<string>res;
			for(ll i=0;i<item;i++){
				string ans;
				for(ll j=0;j<half;j++){
					for(ll k=0;k<=75;k++){
						if(cnt[k]>=2){
							cnt[k]-=2;
							char c=k+'0';
							ans+=c;
						}
					}
				}
				res.push_back(ans);
			}
			for(string ans:res){
				char c;
				if(sz&1){
					for(ll j=0;j<=75;j++){
						if(cnt[j]>=1){
							cnt[j]--;
							c=j+'0';
							break;
						}
					}
				}
				cout<<ans;
				if(sz&1) cout<<c;
				reverse(ans.begin(),ans.end());
				cout<<ans<<" ";
			}
			cout<<endl;
			return 0;
		}
	}
}


  #include <bits/stdc++.h>
  using namespace std;
  #define ll long long int
  #define endl '\n'
  #define pb push_back
  #define mod 1000000007
  #define all(v) v.begin(),v.end()
  bool cmp(pair<ll,ll> a,pair<ll,ll> b){
    if(a.first==b.first){
      return a.second>b.second;
    }
    return a.first>b.first;
  }
  ll power(ll x,  ll y, ll p)
{
    ll res = 1;     // Initialize result

    x = x % p; // Update x if it is more than or
                // equal to p

    if (x == 0) return 0; // In case x is divisible by p;

    while (y > 0)
    {
        // If y is odd, multiply x with result
        if (y & 1)
            res = (res*x) % p;

        // y must be even now
        y = y>>1; // y = y/2
        x = (x*x) % p;
    }
    return res;
}
ll arr[300001]  ;
bool check(ll mid,ll n,ll k){
  queue<pair<ll,ll>> q;
  bool check=false;
  q.push({arr[1],0});
  for(int i=1;i<=n;i++){
    while(!q.empty() && arr[i]-q.front().first>mid){
      q.pop();
    }
    check=false;
    if(!q.empty() && i-q.front().second>=k){
      check=true;
    }
    if(check){
      q.push({arr[i+1],i});
    }

  }
  return check;
}
void solve(){

  ll n;
  cin>>n;
  string s;
  cin>>s;
  map<char,ll> mp;
  for(int i=0;i<n;i++){
    mp[s[i]]++;

  }
  vector<char> even,odd;
  for(auto &it:mp){
    if(it.second%2==1){
      odd.push_back(it.first);
      it.second=it.second-1;
    }
    if(it.second%2==0 && it.second>0){
      while(it.second%2==0 && it.second>0){
       even.push_back(it.first);
       it.second=it.second-2;
      }
    }
  }
  if(odd.size()==0){
    cout<<1<<endl;
    string even1="";
    for(auto it:even){
      even1+=it;
    }
    cout<<even1;
    reverse(all(even1));
    cout<<even1<<endl;
    return ;
  }
  while(even.size()%odd.size()){
    odd.push_back(even.back());
    odd.push_back(even.back());
    even.pop_back();
  }
  cout<<odd.size()<<endl;
  vector<string> final;
  ll k=0;
  for(int i=0;i<odd.size();i++){
    string temp="";
    while(temp.length()!=even.size()/odd.size()){
      temp+=even[k++];
    }
    string temp1=temp;
    reverse(all(temp1));
    temp+=odd[i];
    cout<<temp<<temp1<<" ";
  }
  cout<<endl;
}

int main(){

    #ifndef ONLINE_JUDGE
      freopen("./input.txt", "r", stdin);
          freopen("./output.txt", "w", stdout);
    #endif
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    ll t=1;
//cin>>t;

    for(ll i=0;i<t;i++){
      solve();
    }
    #ifndef ONLINE_JUDGE
      cout<<"Time Elapsed: " << 1.0*clock() / CLOCKS_PER_SEC << " sec\n";
    #endif
    return 0;
}


  #include <bits/stdc++.h>
  using namespace std;
  #define ll long long int
  #define endl '\n'
  #define pb push_back
  #define mod 1000000007
  #define all(v) v.begin(),v.end()
  bool cmp(pair<ll,ll> a,pair<ll,ll> b){
    if(a.first==b.first){
      return a.second>b.second;
    }
    return a.first>b.first;
  }
  ll power(ll x,  ll y, ll p)
{
    ll res = 1;     // Initialize result

    x = x % p; // Update x if it is more than or
                // equal to p

    if (x == 0) return 0; // In case x is divisible by p;

    while (y > 0)
    {
        // If y is odd, multiply x with result
        if (y & 1)
            res = (res*x) % p;

        // y must be even now
        y = y>>1; // y = y/2
        x = (x*x) % p;
    }
    return res;
}
ll arr[300001]  ;
bool check(ll mid,ll n,ll k){
  queue<pair<ll,ll>> q;
  bool check=false;
  q.push({arr[1],0});
  for(int i=1;i<=n;i++){
    while(!q.empty() && arr[i]-q.front().first>mid){
      q.pop();
    }
    check=false;
    if(!q.empty() && i-q.front().second>=k){
      check=true;
    }
    if(check){
      q.push({arr[i+1],i});
    }

  }
  return check;
}
void solve(){

  ll n;
  cin>>n;
  string s;
  cin>>s;
  map<char,ll> mp;
  for(int i=0;i<n;i++){
    mp[s[i]]++;

  }
  string even="";
  vector<string> odd;
  for(auto it:mp){
   // cout<<mp[i]<<" ";
    if(it.second%2==0){
      for(int j=0;j<it.second/2;j++){
        even+=it.first;
      }
    }
    else{
      string res="";
      res+=it.first;

      for(int j=0;j<(it.second-1)/2;j++){
        even+=it.first;
      }
      if(res.length()>0){
        odd.push_back(res);
      }
    }
  }
  if(odd.size()==0){
    cout<<1<<endl<<even<<even<<endl;
    return ;
  }

  ll res=even.length()/odd.size();
  ll rem=even.length()%odd.size();
  if(rem>0 || even.length()==0){
    cout<<n<<endl;
    for(auto it:s){
      cout<<it<<" ";
    }
    cout<<endl;
  }
  else{
    cout<<odd.size()<<endl;
    vector<string> final;
    string temp="";
    int len=even.length();
    for(int i=0;i<len;i++){
       temp+=even[i];
      if((i+1)%res==0){
        final.push_back(temp);
        temp="";
      }

    }
    len=odd.size();
  //  cout<<len<<" "<<final.size()<<endl;
    for(int i=0;i<len;i++){
      cout<<final[i]<<odd[i]<<final[i]<<" ";
    }
    cout<<endl;

  }
}

int main(){

    #ifndef ONLINE_JUDGE
      freopen("./input.txt", "r", stdin);
          freopen("./output.txt", "w", stdout);
    #endif
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    ll t=1;
  //  cin>>t;

    for(ll i=0;i<t;i++){
      solve();
    }
    #ifndef ONLINE_JUDGE
      cout<<"Time Elapsed: " << 1.0*clock() / CLOCKS_PER_SEC << " sec\n";
    #endif
    return 0;
}


  #include <bits/stdc++.h>
  using namespace std;
  #define ll long long int
  #define endl '\n'
  #define pb push_back
  #define mod 1000000007
  #define all(v) v.begin(),v.end()
  bool cmp(pair<ll,ll> a,pair<ll,ll> b){
    if(a.first==b.first){
      return a.second>b.second;
    }
    return a.first>b.first;
  }
  ll power(ll x,  ll y, ll p)
{
    ll res = 1;     // Initialize result

    x = x % p; // Update x if it is more than or
                // equal to p

    if (x == 0) return 0; // In case x is divisible by p;

    while (y > 0)
    {
        // If y is odd, multiply x with result
        if (y & 1)
            res = (res*x) % p;

        // y must be even now
        y = y>>1; // y = y/2
        x = (x*x) % p;
    }
    return res;
}
ll arr[300001]  ;
bool check(ll mid,ll n,ll k){
  queue<pair<ll,ll>> q;
  bool check=false;
  q.push({arr[1],0});
  for(int i=1;i<=n;i++){
    while(!q.empty() && arr[i]-q.front().first>mid){
      q.pop();
    }
    check=false;
    if(!q.empty() && i-q.front().second>=k){
      check=true;
    }
    if(check){
      q.push({arr[i+1],i});
    }

  }
  return check;
}
void solve(){

  ll n;
  cin>>n;
  string s;
  cin>>s;
  map<char,ll> mp;
  for(int i=0;i<n;i++){
    mp[s[i]]++;

  }
  string even="";
  vector<string> odd;
  for(auto it:mp){
   // cout<<mp[i]<<" ";
    if(it.second%2==0){
      for(int j=0;j<it.second/2;j++){
        even+=it.first;
      }
    }
    else{
      string res="";
      res+=it.first;

      for(int j=0;j<(it.second-1)/2;j++){
        even+=it.first;
      }
      if(res.length()>0){
        odd.push_back(res);
      }
    }
  }
  if(odd.size()==0){
    cout<<1<<endl<<even<<even<<endl;
    return ;
  }

  ll res=even.length()/odd.size();
  ll rem=even.length()%odd.size();
  if(rem>0 || even.length()==0){
    cout<<n<<endl;
    for(auto it:s){
      cout<<it<<" ";
    }
    cout<<endl;
  }
  else{
    cout<<res<<endl;
    vector<string> final;
    string temp="";
    int len=even.length();
    for(int i=0;i<len;i++){
       temp+=even[i];
      if((i+1)%res==0){
        final.push_back(temp);
        temp="";
      }

    }
    len=odd.size();
  //  cout<<len<<" "<<final.size()<<endl;
    for(int i=0;i<len;i++){
      cout<<final[i]<<odd[i]<<final[i]<<" ";
    }
    cout<<endl;

  }
}

int main(){

    #ifndef ONLINE_JUDGE
      freopen("./input.txt", "r", stdin);
          freopen("./output.txt", "w", stdout);
    #endif
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    ll t=1;
    //cin>>t;

    for(ll i=0;i<t;i++){
      solve();
    }
    #ifndef ONLINE_JUDGE
      cout<<"Time Elapsed: " << 1.0*clock() / CLOCKS_PER_SEC << " sec\n";
    #endif
    return 0;
}


  #include <bits/stdc++.h>
  using namespace std;
  #define ll long long int
  #define endl '\n'
  #define pb push_back
  #define mod 1000000007
  #define all(v) v.begin(),v.end()
  bool cmp(pair<ll,ll> a,pair<ll,ll> b){
    if(a.first==b.first){
      return a.second>b.second;
    }
    return a.first>b.first;
  }
  ll power(ll x,  ll y, ll p)
{
    ll res = 1;     // Initialize result

    x = x % p; // Update x if it is more than or
                // equal to p

    if (x == 0) return 0; // In case x is divisible by p;

    while (y > 0)
    {
        // If y is odd, multiply x with result
        if (y & 1)
            res = (res*x) % p;

        // y must be even now
        y = y>>1; // y = y/2
        x = (x*x) % p;
    }
    return res;
}
ll arr[300001]  ;
bool check(ll mid,ll n,ll k){
  queue<pair<ll,ll>> q;
  bool check=false;
  q.push({arr[1],0});
  for(int i=1;i<=n;i++){
    while(!q.empty() && arr[i]-q.front().first>mid){
      q.pop();
    }
    check=false;
    if(!q.empty() && i-q.front().second>=k){
      check=true;
    }
    if(check){
      q.push({arr[i+1],i});
    }

  }
  return check;
}
void solve(){

  ll n;
  cin>>n;
  string s;
  cin>>s;
  map<char,ll> mp;
  for(int i=0;i<n;i++){
    mp[s[i]]++;

  }
  string even="";
  vector<string> odd;
  for(auto it:mp){
   // cout<<mp[i]<<" ";
    if(it.second%2==0){
      for(int j=0;j<it.second/2;j++){
        even+=it.first;
      }
    }
    else{
      string res="";
      res+=it.first;

      for(int j=0;j<(it.second-1)/2;j++){
        even+=it.first;
      }
      if(res.length()>0){
        odd.push_back(res);
      }
    }
  }
  if(odd.size()==0){
    cout<<1<<endl;
    cout<<even;
    reverse(all(even));
    cout<<even<<endl;
    return ;
  }

  ll res=even.length()/odd.size();
  ll rem=even.length()%odd.size();
  if(rem>0 || even.length()==0){
    cout<<n<<endl;
    for(auto it:s){
      cout<<it<<" ";
    }
    cout<<endl;
  }
  else{
    cout<<odd.size()<<endl;
    vector<string> final;
    string temp="";
    int len=even.length();
    for(int i=0;i<len;i++){
       temp+=even[i];
      if((i+1)%res==0){
        final.push_back(temp);
        temp="";
      }

    }
    len=odd.size();
  //  cout<<len<<" "<<final.size()<<endl;
    for(int i=0;i<len;i++){
      cout<<final[i]<<odd[i];
      reverse(all(final));
      cout<<final[i]<<" ";
    }
    cout<<endl;

  }
}

int main(){

    #ifndef ONLINE_JUDGE
      freopen("./input.txt", "r", stdin);
          freopen("./output.txt", "w", stdout);
    #endif
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    ll t=1;
  //  cin>>t;

    for(ll i=0;i<t;i++){
      solve();
    }
    #ifndef ONLINE_JUDGE
      cout<<"Time Elapsed: " << 1.0*clock() / CLOCKS_PER_SEC << " sec\n";
    #endif
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define error(x) cerr << #x << " = " << (x) <<endl
#define Error(a,b) cerr<<"( "<<#a<<" , "<<#b<<" ) = ( "<<(a)<<" , "<<(b)<<" )\n";

#define dbg(x) F(i,0,sz(x)) cout << x[i] << " ";

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

	vector<int> factors;

	for(int i = 1; i < sqrt(n) + 1; i++) {
		if(n % i == 0) {factors.push_back(i); factors.push_back(n / i);}
	}

	map<char, int> mp;
	for(int i = 0; i < str.size(); i++) {
		mp[str[i]]++;
	}

	sort(factors.begin(), factors.end());

	int cntOdd = 0;

	for(auto el: mp) {
		if(el.second % 2) cntOdd++;
	}

	int i;
	for(i = 0; i < factors.size(); i++) {
		int ng = factors[i];
		int glen = n / ng;
		Error(ng, cntOdd);
		if(ng - cntOdd >= 0 && ((ng - cntOdd) % 2 == 0 || cntOdd == 0) ) {
			error(i);
			if((glen % 2 != 0) || cntOdd == 0)
				break;
		}
	}

	int ng = factors[i];
	int glen = n / ng;

	std::vector<char> middleElement;

	for(auto & el: mp) {
		if(el.second % 2) middleElement.push_back(el.first);}

	if(ng > middleElement.size()) {
		for(auto & el: mp) {
			while(el.second >= 2 && ng > middleElement.size()) {
				error(el.first);
				middleElement.push_back(el.first);
				middleElement.push_back(el.first);
				el.second -= 2;
			}
		}
	}

	std::vector<char> normalElement;
	for(auto & el: mp) {
		while(el.second >= 2) {
			normalElement.push_back(el.first);
			normalElement.push_back(el.first);
			el.second -= 2;
		}
	}

	int k = 0, l = 0;
	cout << ng << endl;
	for(int i = 0; i < ng; i++) {
		string ret(glen, '0');
		for(int j = 0; j < glen / 2; j++) {
			ret[j] = normalElement[k];
			ret[glen - 1 - j] = normalElement[k++];
		}
		if(glen % 2) {
			ret[glen / 2] = middleElement[l++];
		}
		cout << ret << " ";
	}
}

int main() {
	#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);freopen("output.txt", "w", stdout);
	#endif
	time_t startt = clock();

	int t = 1;
	for(int tt = 0; tt < t; tt++) {
		solve();
		cerr << "~ #" << tt << " done! time : " << (double)(clock()-startt) * 1000/CLOCKS_PER_SEC << " ms" << endl;
	}
}


#include <bits/stdc++.h>

using namespace std;

#define error(x) cerr << #x << " = " << (x) <<endl
#define Error(a,b) cerr<<"( "<<#a<<" , "<<#b<<" ) = ( "<<(a)<<" , "<<(b)<<" )\n";

#define dbg(x) F(i,0,sz(x)) cout << x[i] << " ";

void anss(long long x, long long t) {
	cout << "Case #" << t << ": " << x << endl;
}

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

	vector<int> factors;

	for(int i = 1; i < sqrt(n) + 1; i++) {
		if(n % i == 0) {factors.push_back(i); factors.push_back(n / i);}
	}

	map<char, int> mp;
	for(int i = 0; i < str.size(); i++) {
		mp[str[i]]++;
	}
	sort(factors.begin(), factors.end());
	// reverse(factors.begin(), factors.end());

	int i;
	for(i = 0; i < factors.size(); i++) {
		int times = factors[i];
		int each = n / times;
		if(each % 2) {
			int cnt = 0;
			for(auto el: mp) {
				cnt += (el.second % 2);
			}
			if(times == cnt) break;
		} else {
			int cnt = 0;
			for(auto el: mp) {
				cnt += (el.second % 2);
			}
			if(cnt == 0) break;
		}
	}
	map <char, int> taken;
	int cnt = factors[i];
	int each = n / cnt;
	cout << cnt << endl;
	for(int i = 0; i < cnt; i++) {
		string ret(each, '0');
		for(int j = 0; j < each / 2; j++) {
			char ch;
			for(auto el: mp){
				if(el.second % 2 == 0) {ch = el.first; break;}
			}
			ret[j] = ch;
			ret[each - 1 - j] = ch;
			mp[ch] -= 2;
			if(!mp[ch]){
				mp.erase(mp.find(ch));
			}
		}

		if(each % 2) {
			char ch;
			for(auto el: mp){
				if(el.second % 2 == 1) {ch = el.first; break;}
			}
			ret[each / 2] = ch;
			mp[ch] -= 1;
			if(!mp[ch]){
				mp.erase(mp.find(ch));
			}
		}
		cout << ret << " ";
	}
}

int main() {
	#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);freopen("output.txt", "w", stdout);
	#endif
	time_t startt = clock();

	int t = 1;
	for(int tt = 0; tt < t; tt++) {
		solve();
		cerr << "~ #" << tt << " done! time : " << (double)(clock()-startt) * 1000/CLOCKS_PER_SEC << " ms" << endl;
	}

}


#include <bits/stdc++.h>

using namespace std;

#define error(x) cerr << #x << " = " << (x) <<endl
#define Error(a,b) cerr<<"( "<<#a<<" , "<<#b<<" ) = ( "<<(a)<<" , "<<(b)<<" )\n";

#define dbg(x) F(i,0,sz(x)) cout << x[i] << " ";

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

	vector<int> factors;

	for(int i = 1; i < sqrt(n) + 1; i++) {
		if(n % i == 0) {factors.push_back(i); factors.push_back(n / i);}
	}

	map<char, int> mp;
	for(int i = 0; i < str.size(); i++) {
		mp[str[i]]++;
	}

	sort(factors.begin(), factors.end());

	int cntOdd = 0;

	for(auto el: mp) {
		if(el.second % 2) cntOdd++;
	}

	int i;
	for(i = 0; i < factors.size(); i++) {
		int ng = factors[i];
		int glen = n / ng;
		Error(ng, cntOdd);
		if(ng - cntOdd >= 0 && ((ng - cntOdd) % 2 == 0 || cntOdd == 0) ) {
			error(i);
			if((glen % 2 != 0) || cntOdd == 0)
				break;
		}
	}

	int ng = factors[i];
	int glen = n / ng;

	std::vector<char> middleElement;

	for(auto & el: mp) {
		if(el.second % 2) middleElement.push_back(el.first);}

	if(ng > middleElement.size() + 1) {
		for(auto & el: mp) {
			while(el.second >= 2 && ng > middleElement.size()) {
				middleElement.push_back(el.first);
				middleElement.push_back(el.first);
				el.second -= 2;
			}
		}
	}

	std::vector<char> normalElement;
	for(auto & el: mp) {
		while(el.second >= 2) {
			normalElement.push_back(el.first);
			el.second -= 2;
			// Error(el.second, mp[el.first]);
		}
	}

	int k = 0, l = 0;
	cout << ng << endl;
	for(int i = 0; i < ng; i++) {
		string ret(glen, '0');
		for(int j = 0; j < glen / 2; j++) {
			ret[j] = normalElement[k];
			ret[glen - 1 - j] = normalElement[k++];
		}
		if(glen % 2) {
			ret[glen / 2] = middleElement[l++];
		}
		cout << ret << " ";
	}
}

int main() {
	#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);freopen("output.txt", "w", stdout);
	#endif
	time_t startt = clock();

	int t = 1;
	for(int tt = 0; tt < t; tt++) {
		solve();
		cerr << "~ #" << tt << " done! time : " << (double)(clock()-startt) * 1000/CLOCKS_PER_SEC << " ms" << endl;
	}
}


#include <bits/stdc++.h>

using namespace std;

#define error(x) cerr << #x << " = " << (x) <<endl
#define Error(a,b) cerr<<"( "<<#a<<" , "<<#b<<" ) = ( "<<(a)<<" , "<<(b)<<" )\n";

#define dbg(x) F(i,0,sz(x)) cout << x[i] << " ";

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

	vector<int> factors;

	for(int i = 1; i < sqrt(n) + 1; i++) {
		if(n % i == 0) {factors.push_back(i); factors.push_back(n / i);}
	}

	map<char, int> mp;
	for(int i = 0; i < str.size(); i++) {
		mp[str[i]]++;
	}

	sort(factors.begin(), factors.end());

	int cntOdd = 0;

	for(auto el: mp) {
		if(el.second % 2) cntOdd++;
	}

	int i;
	for(i = 0; i < factors.size(); i++) {
		int ng = factors[i];
		int glen = n / ng;
		Error(ng, cntOdd);
		if(ng - cntOdd >= 0 && ((ng - cntOdd) % 2 == 0 || cntOdd == 0) ) {
			error(i);
			if((glen % 2 != 0) || cntOdd == 0)
				break;
		}
	}

	int ng = factors[i];
	int glen = n / ng;

	std::vector<char> middleElement;

	for(auto & el: mp) {
		if(el.second % 2) middleElement.push_back(el.first);}

	if(ng > middleElement.size() + 1) {
		for(auto & el: mp) {
			while(el.second >= 2 && ng > middleElement.size()) {
				middleElement.push_back(el.first);
				middleElement.push_back(el.first);
				el.second -= 2;
			}
		}
	}

	std::vector<char> normalElement;
	for(auto & el: mp) {
		while(el.second >= 2) {
			normalElement.push_back(el.first);
			el.second -= 2;
			Error(el.second, mp[el.first]);
		}
	}

	int k = 0, l = 0;
	cout << ng << endl;
	for(int i = 0; i < ng; i++) {
		string ret(glen, '0');
		for(int j = 0; j < glen / 2; j++) {
			ret[j] = normalElement[k];
			ret[glen - 1 - j] = normalElement[k++];
		}
		if(glen % 2) {
			ret[glen / 2] = middleElement[l++];
		}
		cout << ret << " ";
	}
}

int main() {
	#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);freopen("output.txt", "w", stdout);
	#endif
	time_t startt = clock();

	int t = 1;
	for(int tt = 0; tt < t; tt++) {
		solve();
		cerr << "~ #" << tt << " done! time : " << (double)(clock()-startt) * 1000/CLOCKS_PER_SEC << " ms" << endl;
	}
}


#include <bits/stdc++.h>

using namespace std;

#define error(x) cerr << #x << " = " << (x) <<endl
#define Error(a,b) cerr<<"( "<<#a<<" , "<<#b<<" ) = ( "<<(a)<<" , "<<(b)<<" )\n";

#define dbg(x) F(i,0,sz(x)) cout << x[i] << " ";

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

	vector<int> factors;

	for(int i = 1; i < sqrt(n) + 1; i++) {
		if(n % i == 0) {factors.push_back(i); factors.push_back(n / i);}
	}

	map<char, int> mp;
	for(int i = 0; i < str.size(); i++) {
		mp[str[i]]++;
	}

	sort(factors.begin(), factors.end());

	int cntOdd = 0;

	for(auto el: mp) {
		if(el.second % 2) cntOdd++;
	}

	int i;
	for(i = 0; i < factors.size(); i++) {
		int ng = factors[i];
		int glen = n / ng;
		Error(ng, cntOdd);
		if(ng - cntOdd >= 0 && ((ng - cntOdd) % 2 == 0 || cntOdd == 0) ) {
			error(i);
			if((glen % 2 != 0) || cntOdd == 0)
				break;
		}
	}

	int ng = factors[i];
	int glen = n / ng;

	std::vector<char> middleElement;

	for(auto & el: mp) {
		if(el.second % 2) middleElement.push_back(el.first);}

	if(ng > middleElement.size()) {
		for(auto & el: mp) {
			while(el.second >= 2 && ng > middleElement.size()) {
				error(el.first);
				middleElement.push_back(el.first);
				middleElement.push_back(el.first);
				el.second -= 2;
			}
		}
	}

	std::vector<char> normalElement;
	for(auto & el: mp) {
		while(el.second >= 2) {
			normalElement.push_back(el.first);
			normalElement.push_back(el.first);
			el.second -= 2;
		}
	}

	int k = 0, l = 0;
	for(int i = 0; i < ng; i++) {
		string ret(glen, '0');
		for(int j = 0; j < glen / 2; j++) {
			ret[j] = normalElement[k];
			ret[glen - 1 - j] = normalElement[k++];
		}
		if(glen % 2) {
			ret[glen / 2] = middleElement[l++];
		}
		cout << ret << " ";
	}
}

int main() {
	#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);freopen("output.txt", "w", stdout);
	#endif
	time_t startt = clock();

	int t = 1;
	for(int tt = 0; tt < t; tt++) {
		solve();
		cerr << "~ #" << tt << " done! time : " << (double)(clock()-startt) * 1000/CLOCKS_PER_SEC << " ms" << endl;
	}
}


#include <bits/stdc++.h>

using namespace std;

#define error(x) cerr << #x << " = " << (x) <<endl
#define Error(a,b) cerr<<"( "<<#a<<" , "<<#b<<" ) = ( "<<(a)<<" , "<<(b)<<" )\n";

#define dbg(x) F(i,0,sz(x)) cout << x[i] << " ";

void anss(long long x, long long t) {
	cout << "Case #" << t << ": " << x << endl;
}

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

	vector<int> factors;

	for(int i = 1; i < sqrt(n) + 1; i++) {
		if(n % i == 0) {factors.push_back(i); factors.push_back(n / i);}
	}

	map<char, int> mp;
	for(int i = 0; i < str.size(); i++) {
		mp[str[i]]++;
	}
	sort(factors.begin(), factors.end());
	// reverse(factors.begin(), factors.end());
	int i;
	for(i = 0; i < factors.size(); i++) {
		int times = factors[i];
		int each = n / times;
		if(each % 2) {
			int cnt = 0;
			for(auto el: mp) {
				cnt += (el.second % 2);
			}
			if(times == cnt) break;
		} else {
			int cnt = 0;
			for(auto el: mp) {
				cnt += (el.second % 2);
			}
			if(cnt == 0) break;
		}
	}
	if(i >= factors.size()) {
		cout << str.size() << endl;
		for(int j = 0; j < str.size(); j++){
			cout << str[j] << " ";
		}
		return 0;
	}
	map <char, int> taken;
	int cnt = factors[i];
	int each = n / cnt;
	cout << cnt << endl;
	for(int i = 0; i < cnt; i++) {
		string ret(each, '0');
		for(int j = 0; j < each / 2; j++) {
			char ch;
			for(auto el: mp){
				if(el.second % 2 == 0) {ch = el.first; break;}
			}
			ret[j] = ch;
			ret[each - 1 - j] = ch;
			mp[ch] -= 2;
			if(!mp[ch]){
				mp.erase(mp.find(ch));
			}
		}

		if(each % 2) {
			char ch;
			for(auto el: mp){
				if(el.second % 2 == 1) {ch = el.first; break;}
			}
			ret[each / 2] = ch;
			mp[ch] -= 1;
			if(!mp[ch]){
				mp.erase(mp.find(ch));
			}
		}
		cout << ret << " ";
	}
}

int main() {
	#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);freopen("output.txt", "w", stdout);
	#endif
	time_t startt = clock();

	int t = 1;
	for(int tt = 0; tt < t; tt++) {
		solve();
		cerr << "~ #" << tt << " done! time : " << (double)(clock()-startt) * 1000/CLOCKS_PER_SEC << " ms" << endl;
	}

}


#include<iostream>
#include<cmath>
#include<vector>
#include<string>
#include<set>
#include<algorithm>
#include<map>
#include<stack>
#include<queue>

using namespace std;

typedef long double ld;
typedef long long ll;
typedef pair<ll, ll> pi;
typedef vector<ll> vi;
typedef vector<vi> vvi;
typedef vector<bool> vb;
typedef vector<pi> vpi;
typedef vector<vpi> vvpi;
typedef map<ll, ll> mii;
typedef set<ll> si;
typedef multiset<ll> msi;
typedef vector<si> vsi;
typedef vector<string> vs;

template <typename T> using V = vector<T>;
template <typename T> using VV = vector<V<T>>;
template < typename T >
istream& operator>> (istream& cin, V<T>& arr){
	for (T& val : arr)	{
		cin >> val;
	}
	return cin;
}
template < typename T >
ostream& operator<< (ostream& cout, V<T>& arr){
	for (T& val : arr)	{
		cout << val << " ";
	}
	return cout;
}

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0); cout.tie(0);
	cout.precision(10);
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);

	ll n;
	cin >> n;
	string s;
	cin >> s;
	map<char, int> cnt;
	for (char c : s) {
		cnt[c]++;
	}
	ll odd = 0;
	vector<char> middle;
	for (auto& it : cnt) {
		if (it.second % 2) {
			odd++;
			middle.push_back(it.first);
			it.second--;
		}
	}
	ll num = max(odd, (ll)1);
	while (n % num || odd && ((n - num) / num) % 2)
		num++;

	if (odd && odd < num)
		for (auto& it : cnt) {
			while (it.second && odd < num) {
				middle.push_back(it.first);
				middle.push_back(it.first);
				odd += 2;
				it.second -= 2;
			}
		}

	vector<string> ans(num);
	auto it = cnt.begin();
	for (int i = 0; i < num; i++) {
		stack<char> st;
		ll k = 0;
		ll len = n / num;
		len /= 2;
		while (k < len) {
			while (it->second && k < len) {
				ans[i] += it->first;
				st.push(it->first);
				k++;
				it->second -= 2;
			}
			if (!(it->second))
				it++;
		}
		if (odd)
			ans[i] += middle[i];
		for (ll j = 0; j < len; j++) {
			ans[i] += st.top();
			st.pop();
		}
	}
	cout << num << '\n';
	cout << ans;

	return 0;
}


/*
	Nishant Singh
	nishant.ns19
*/
#include <bits/stdc++.h>
#include <functional>
#include <iostream>

// ******** Big Integer ********
// #include <boost/multiprecision/cpp_int.hpp>
// using namespace boost::multiprecision;
// #define ll1024  int1024_t
// ******** Big Integer ********

// ******** Using PBDS ********
// #include <ext/pb_ds/assoc_container.hpp> // Common file
// #include <ext/pb_ds/tree_policy.hpp>
// using namespace __gnu_pbds;
// ******** Using PBDS ********

using namespace std;
#define ll long long
#define ld long double
#define pll pair<long long,long long>
#define pii pair<int,int>
#define vll vector<ll>
#define vec vector
#define setcount(x) __builtin_popcountll(x)
#define f first
#define s second
#define mp make_pair
#define REP(i,n) for(ll i=0;i<(n);i++)
#define FOR(i,a,b) for(ll i=(a);i<=(b);i++)
#define REV(i,a,b) for(ll i=(a);i>=(b);i--)
#define pb push_back
#define in insert
#define init(x,a) memset(x,a,sizeof(x))
#define all(c) c.begin(),c.end()
#define pq priority_queue
#define ffl fflush(stdout)
#define mset multiset
#define out(x) cout<<#x<<" = "<<" "<<x<<"\n";
#define ub upper_bound
#define lb lower_bound
#define ln "\n"
#define Y "YES"
#define N "NO"
ll const mod=1e9 + 7;
ll const inf=2e18;

// ******** Using PBDS ********
// typedef tree<long long, null_type, less<long long>, rb_tree_tag,
//              tree_order_statistics_node_update>
//                 os;
// ******** Using PBDS ********

inline ll add(ll a,ll b)
{
	return (a%mod + b%mod + mod)%mod;
}

inline ll mul(ll a,ll b)
{
	return (a%mod * b%mod + mod)%mod;
}

inline ll sub(ll a,ll b)
{
	return (a%mod - b%mod + mod)%mod;
}

ll gcd(ll a,ll b)
{
	if (b == 0)
		return a;
	return gcd(b, a % b);
}

ll modexp(ll x, ll n){
	if(n==0){
		return 1;
	}
	else if(n&1){
		return (modexp((x*x)%mod, n/2)%mod * x%mod)%mod;
	}
	else{
		return (modexp((x*x)%mod, n/2)%mod);
	}
}

ll modinv(ll n)
{
	return modexp(n,mod-2);
}

// ******** GLOBAL VARIABLES ********

map<char,int> m1;
stack<char> odd;
ll tot=0;
ll n;
// ******** GLOBAL VARIABLES ********
bool check(int mid)
{
	if(!(mid&1))
	{
		if(odd.size()>0)
			return false;
	}
	ll k=(n/mid);
	ll req_pairs=(mid/2)*k;
	if(tot>=req_pairs)
	{
		return true;
	}
	return false;

}
void make(int ans)
{
	ll k=(n/ans);
	string temp(n,'#');
	int i=0;
	for(auto it:m1)
	{
		int p=it.s/2;
		while(p--)
		{
			temp[i]=it.f;
			temp[i+1]=it.f;
			i=i+2;
		}
	}
	while(odd.size()>0)
	{
		temp[i++]=odd.top();
		odd.pop();
	}
	i=0;
	int j=n-1;
	while(k--)
	{
		int l=0,r=ans-1;
		string cur(ans,'#');
		while(l<r)
		{
			cur[l]=temp[i];
			cur[r]=temp[i];
			i=i+2;
			l++;
			r--;

		}
		if(l==r)
			cur[l]=temp[j--];
		cout<<cur<<" ";

	}

}

void solve(){
	string st;
	cin>>n>>st;
	REP(i,n)
	m1[st[i]]++;

	ll ans=1;
	for(auto it:m1)
	{
		tot+=((it.s)/2);
		if(it.s&1)
			odd.push(it.f);
	}
	for(int i=1;(i*i)<=n;i++)
	{
		if(n%i==0)
		{
			ll f1=i;
			ll f2=n/i;
			if(check(f1))
			{
				ans=max(ans,f1);

			}
			if(check(f2))
			{
				ans=max(ans,f2);

			}
		}
	}
	cout<<(n/ans)<<ln;
	make(ans);

}

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	ll T=1;
	// cin>>T;
	for(int t=1;t<=T;t++)
	{
		// cout<<"Case #"<<t<<": ";
		solve();
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
int solve(char a, char b, char c, char d)
{
	if (a == c && b == d)
		return 0;
	if (a == d && b == c)
		return 0;
	if (a == b && c == d)
		return 0;
	if (a == b)
		return 1;;
	if (a == d)
		return 1;
	if (b == c)
		return 1;
	if (b == d)
		return 1;
	if (c == d)
		return 1;
	return 2;
}
int main(int argc, char const *argv[])
{
	int n, ans = 0;
	cin >> n;
	string a, b;
	cin >> a >> b;
	for (int i = 0; i < n / 2; ++i)
	{
		ans += solve(a[i], a[n - 1 - i], b[i], b[n - 1 - i]);
	}
	if ((n & 1) && a[n / 2] != b[n / 2])
		ans ++;
	cout << ans << '\n';
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define mod 300000007ll
#define vll vector<ll>
#define pll pair<ll,ll>
#define vpll vector<pll>
#define pb push_back
#define mp make_pair
#define x first
#define y second
#define db(x) cout << #x << " = " << x << '\n'
#define sep cout << "\n********************************************\n"
#define fast  ios_base::sync_with_stdio(false), cin.tie(NULL)
ll n, oc = 0;
string s;
ll a[300];
int main(int argc, char const *argv[])
{
	fast;
	cin >> n;
	cin >> s;
	for (int i = 0; i < n; ++i)
	{
		a[(int)s[i]] ++;
	}

	for (int i = 0; i < 300; ++i)
	{
		oc += (a[i] & 1);
	}
	if (oc == 0)
	{
		cout << 1 << '\n';
		string ans(n, 'a');
		ll l = 0, r = n - 1;
		for (int i = 0; i < 300; ++i)
		{
			while (a[i] && l < r)
			{
				ans[l] = (char)i;
				ans[r] = (char)i;
				l ++;
				r --;
				a[i] -= 2;
			}
		}
		cout << ans << '\n';
	}
	else if (oc == 1)
	{
		cout << 1 << '\n';
		string ans(n, 'a');
		ll l = 0, r = n - 1;
		for (int i = 0; i < 300; ++i)
		{
			if (a[i] & 1)
			{
				ans[n / 2] = (char)i;
				a[i] --;
			}
			while (a[i] && l < r)
			{
				ans[l] = (char)i;
				ans[r] = (char)i;
				l ++;
				r --;
				a[i] -= 2;
			}
		}
		cout << ans << '\n';
	}
	else
	{
		for (ll len = n; len >= 1; --len)
		{
			if (n % len || len % 2 == 0)
				continue;
			ll k = n / len, idx = 0;
			if (k < oc)
				continue;
			if ((k - oc) % 2)
				continue;
			cout << k << '\n';
			vector<string> ans(k, string(len, 'a'));
			for (int i = 0; i < 300 && idx < k; ++i)
			{
				if (a[i] & 1)
				{
					ans[idx][len / 2] = (char)i;
					a[i] --;
					idx ++;
				}
			}
			for (int i = 0; i < 300 && idx < k; ++i)
			{
				while (a[i] > 1 && idx < k)
				{
					ans[idx][len / 2] = (char)i;
					a[i] --;
					idx ++;
					ans[idx][len / 2] = (char)i;
					a[i] --;
					idx ++;
				}
			}
			for (int i = 0; i < k; ++i)
			{
				ll l = len / 2 - 1;
				ll r = len / 2 + 1;
				for (int c = 0; c < 300; ++c)
				{
					while (l >= 0 && r < len && a[c])
					{
						ans[i][l] = ans[i][r] = (char)c;
						a[c] -= 2;
						l --;
						r ++;
					}
				}
			}
			for (int i = 0; i < k; ++i)
			{
				cout << ans[i] << ' ';
			}
			break;
		}
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define mod 300000007ll
#define vll vector<ll>
#define pll pair<ll,ll>
#define vpll vector<pll>
#define pb push_back
#define mp make_pair
#define x first
#define y second
#define db(x) cout << #x << " = " << x << '\n'
#define sep cout << "\n********************************************\n"
#define fast  ios_base::sync_with_stdio(false), cin.tie(NULL)
ll n, oc = 0;
string s;
ll a[300];
int main(int argc, char const *argv[])
{
	cin >> n;
	cin >> s;
	for (int i = 0; i < n; ++i)
	{
		a[(int)s[i]] ++;
	}

	for (int i = 0; i < 300; ++i)
	{
		oc += (a[i] & 1);
	}
	if (oc == 0)
	{
		cout << 1 << '\n';
		string ans(n, 'a');
		ll l = 0, r = n - 1;
		for (int i = 0; i < 300; ++i)
		{
			while (a[i] && l < r)
			{
				ans[l] = (char)i;
				ans[r] = (char)i;
				l ++;
				r --;
				a[i] -= 2;
			}
		}
		cout << ans << '\n';
	}
	else if (oc == 1)
	{
		cout << 1 << '\n';
		string ans(n, 'a');
		ll l = 0, r = n - 1;
		for (int i = 0; i < 300; ++i)
		{
			if (a[i] & 1)
			{
				ans[n / 2] = (char)i;
				a[i] --;
			}
			while (a[i] && l < r)
			{
				ans[l] = (char)i;
				ans[r] = (char)i;
				l ++;
				r --;
				a[i] -= 2;
			}
		}
		cout << ans << '\n';
	}
	else
	{
		for (ll len = n; len >= 1; --len)
		{
			if (n % len || len % 2 == 0)
				continue;
			ll k = n / len, idx = 0;
			if (k < oc)
				continue;
			if ((k - oc) % 2)
				continue;
			cout << k << '\n';
			vector<string> ans(k, string(len, 'a'));
			for (int i = 0; i < 300 && idx < k; ++i)
			{
				if (a[i] & 1)
				{
					ans[idx][len / 2] = (char)i;
					a[i] --;
					idx ++;
				}
			}
			for (int i = 0; i < 300 && idx < k; ++i)
			{
				while (a[i] > 2 && idx < k)
				{
					ans[idx][len / 2] = (char)i;
					a[i] --;
					idx ++;
					ans[idx][len / 2] = (char)i;
					a[i] --;
					idx ++;
				}
			}
			for (int i = 0; i < k; ++i)
			{
				ll l = len / 2 - 1;
				ll r = len / 2 + 1;
				for (int c = 0; c < 300; ++c)
				{
					while (l >= 0 && r < len && a[c])
					{
						ans[i][l] = ans[i][r] = (char)c;
						a[c] -= 2;
						l --;
						r ++;
					}
				}
			}
			for (int i = 0; i < k; ++i)
			{
				cout << ans[i] << ' ';
			}
			break;
		}
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define mod 300000007ll
#define vll vector<ll>
#define pll pair<ll,ll>
#define vpll vector<pll>
#define pb push_back
#define mp make_pair
#define x first
#define y second
#define db(x) cout << #x << " = " << x << '\n'
#define sep cout << "\n********************************************\n"
#define fast  ios_base::sync_with_stdio(false), cin.tie(NULL)
ll n, oc = 0;
string s;
ll a[300];
int main(int argc, char const *argv[])
{
	cin >> n;
	cin >> s;
	for (int i = 0; i < n; ++i)
	{
		a[(int)s[i]] ++;
	}

	for (int i = 0; i < 300; ++i)
	{
		oc += (a[i] & 1);
	}
	if (oc == 0)
	{
		cout << 1 << '\n';
		string ans(n, 'a');
		ll l = 0, r = n - 1;
		for (int i = 0; i < 300; ++i)
		{
			while (a[i] && l < r)
			{
				ans[l] = (char)i;
				ans[r] = (char)i;
				l ++;
				r --;
				a[i] -= 2;
			}
		}
		cout << ans << '\n';
	}
	else if (oc == 1)
	{
		cout << 1 << '\n';
		string ans(n, 'a');
		ll l = 0, r = n - 1;
		for (int i = 0; i < 300; ++i)
		{
			if (a[i] & 1)
			{
				ans[n / 2] = (char)i;
				a[i] --;
			}
			while (a[i] && l < r)
			{
				ans[l] = (char)i;
				ans[r] = (char)i;
				l ++;
				r --;
				a[i] -= 2;
			}
		}
		cout << ans << '\n';
	}
	else
	{
		for (ll len = n; len >= 1; --len)
		{
			if (n % len || len % 2 == 0)
				continue;
			ll k = n / len, idx = 0;
			if (k < oc)
				continue;
			if ((k - oc) % 2)
				continue;
			cout << k << '\n';
			vector<string> ans(k, string(len, 'a'));
			for (int i = 0; i < 300 && idx < k; ++i)
			{
				if (a[i] & 1)
				{
					ans[idx][len / 2] = (char)i;
					a[i] --;
					idx ++;
				}
			}
			for (int i = 0; i < 300 && idx < k; ++i)
			{
				if (a[i])
				{
					ans[idx][len / 2] = (char)i;
					a[i] --;
					idx ++;
					ans[idx][len / 2] = (char)i;
					a[i] --;
					idx ++;
				}
			}
			for (int i = 0; i < k; ++i)
			{
				ll l = len / 2 - 1;
				ll r = len / 2 + 1;
				for (int c = 0; c < 300; ++c)
				{
					while (l >= 0 && r < len && a[c])
					{
						ans[i][l] = ans[i][r] = (char)c;
						a[c] -= 2;
						l --;
						r ++;
					}
				}
			}
			for (int i = 0; i < k; ++i)
			{
				cout << ans[i] << ' ';
			}
			break;
		}
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define mod 300000007ll
#define vll vector<ll>
#define pll pair<ll,ll>
#define vpll vector<pll>
#define pb push_back
#define mp make_pair
#define x first
#define y second
#define db(x) cout << #x << " = " << x << '\n'
#define sep cout << "\n********************************************\n"
#define fast  ios_base::sync_with_stdio(false), cin.tie(NULL)
ll n, oc = 0;
string s;
ll a[300];
int main(int argc, char const *argv[])
{
	cin >> n;
	cin >> s;
	for (int i = 0; i < n; ++i)
	{
		a[(int)s[i]] ++;
	}

	for (int i = 0; i < 300; ++i)
	{
		oc += (a[i] & 1);
	}
	if (oc == 0)
	{
		cout << 1 << '\n';
		string ans(n, 'a');
		ll l = 0, r = n - 1;
		for (int i = 0; i < 300; ++i)
		{
			while (a[i] && l < r)
			{
				ans[l] = (char)i;
				ans[r] = (char)i;
				l ++;
				r --;
				a[i] -= 2;
			}
		}
		cout << ans << '\n';
	}
	else if (oc == 1)
	{
		cout << 1 << '\n';
		string ans(n, 'a');
		ll l = 0, r = n - 1;
		for (int i = 0; i < 300; ++i)
		{
			if (a[i] & 1)
			{
				ans[n / 2] = (char)i;
				a[i] --;
			}
			while (a[i] && l < r)
			{
				ans[l] = (char)i;
				ans[r] = (char)i;
				l ++;
				r --;
				a[i] -= 2;
			}
		}
		cout << ans << '\n';
	}
	else
	{
		for (ll len = n; len >= 1; --len)
		{
			if (n % len || len % 2 == 0)
				continue;
			ll k = n / len, idx = 0;
			if (k < oc)
				continue;
			if ((k - oc) % 2)
				continue;
			cout << k << '\n';
			vector<string> ans(k, string(len, 'a'));
			for (int i = 0; i < 300 && idx < k; ++i)
			{
				if (a[i] & 1)
				{
					ans[idx][len / 2] = (char)i;
					a[i] --;
					idx ++;
				}
			}
			for (int i = 0; i < 300 && idx < k; ++i)
			{
				while (a[i] > 1 && idx < k)
				{
					ans[idx][len / 2] = (char)i;
					a[i] --;
					idx ++;
					ans[idx][len / 2] = (char)i;
					a[i] --;
					idx ++;
				}
			}
			for (int i = 0; i < k; ++i)
			{
				ll l = len / 2 - 1;
				ll r = len / 2 + 1;
				for (int c = 0; c < 300; ++c)
				{
					while (l >= 0 && r < len && a[c])
					{
						ans[i][l] = ans[i][r] = (char)c;
						a[c] -= 2;
						l --;
						r ++;
					}
				}
			}
			for (int i = 0; i < k; ++i)
			{
				cout << ans[i] << ' ';
			}
			break;
		}
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define mod 1000000007ll
#define vll vector<ll>
#define pll pair<ll,ll>
#define vpll vector<pll>
#define pb push_back
#define mp make_pair
#define x first
#define y second
#define db(x) cout << #x << " = " << x << '\n'
#define sep cout << "\n********************************************\n"
#define fast  ios_base::sync_with_stdio(false), cin.tie(NULL)
ll n, oc = 0;
string s;
ll a[1000];
int main(int argc, char const *argv[])
{
	cin >> n;
	cin >> s;
	for (int i = 0; i < n; ++i)
	{
		a[s[i]] ++;
	}

	for (int i = 0; i < 1000; ++i)
	{
		oc += (a[i] & 1);
	}
	if (oc == 0)
	{
		cout << 1 << '\n';
		string ans(n, 'a');
		ll l = 0, r = n - 1;
		for (int i = 0; i < 1000; ++i)
		{
			while (a[i])
			{
				ans[l] = (char)i;
				ans[r] = (char)i;
				l ++;
				r --;
				a[i] -= 2;
			}
		}
		cout << ans << '\n';
	}
	else
	{
		cout << oc << '\n';
		ll len = n / oc, idx = 0;
		vector<string> ans(oc, string(len, 'a'));
		for (int i = 0; i < 1000; ++i)
		{
			if (a[i] & 1)
			{
				ans[idx][len / 2] = (char)i;
				a[i] --;
				idx ++;
			}
		}
		idx = 0;
		for (int i = 0; i < 1000; ++i)
		{
			ll cl = 1, l = len / 2 + 1, r = len / 2 - 1;
			while (a[i] > 0 && cl < len)
			{
				ans[idx][l] = ans[idx][r] = (char)i;
				l ++;
				r ++;
				cl += 2;
			}
			if (cl == len)
				idx ++;
		}
		for (int i = 0; i < oc; ++i)
		{
			cout << ans[i] << ' ';
		}
	}

	return 0;
}


#include <bits/stdc++.h>
using namespace std;
bool chk(string &t)
{
	int l = 0, r = (int)s.length()
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define mod 1000000007ll
#define vll vector<ll>
#define pll pair<ll,ll>
#define vpll vector<pll>
#define pb push_back
#define mp make_pair
#define x first
#define y second
#define db(x) cout << #x << " = " << x << '\n'
#define sep cout << "\n********************************************\n"
#define fast  ios_base::sync_with_stdio(false), cin.tie(NULL)
ll n, oc = 0;
string s;
ll a[1000];
int main(int argc, char const *argv[])
{
	cin >> n;
	cin >> s;
	for (int i = 0; i < n; ++i)
	{
		a[(int)s[i]] ++;
	}

	for (int i = 0; i < 1000; ++i)
	{
		oc += (a[i] & 1);
	}
	if (oc == 0)
	{
		cout << 1 << '\n';
		string ans(n, 'a');
		ll l = 0, r = n - 1;
		for (int i = 0; i < 1000; ++i)
		{
			while (a[i])
			{
				ans[l] = (char)i;
				ans[r] = (char)i;
				l ++;
				r --;
				a[i] -= 2;
			}
		}
		cout << ans << '\n';
	}
	else
	{
		cout << oc << '\n';
		ll len = n / oc, idx = 0;
		vector<string> ans(oc, string(len, 'a'));
		for (int i = 0; i < 1000; ++i)
		{
			if (a[i] & 1)
			{
				ans[idx][len / 2] = (char)i;
				a[i] --;
				idx ++;
			}
		}
		idx = 0;
		for (int i = 0; i < 1000; ++i)
		{
			ll cl = 1, l = len / 2 + 1, r = len / 2 - 1;
			while (a[i] > 0 && cl < len)
			{
				ans[idx][l] = ans[idx][r] = (char)i;
				l ++;
				r ++;
				cl += 2;
				a[i] -= 2;
			}
			if (cl == len)
				idx ++;
		}
		for (int i = 0; i < oc; ++i)
		{
			cout << ans[i] << ' ';
		}
	}

	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 <queue>
#include <bitset>
#include <stack>
#include <iomanip>
#define sig(x) ((x) < 0 ? -1 : 1)
using namespace std;
#define all(x) x.begin(), x.end()
typedef vector <int> vi;
typedef pair<int,int> ii;
typedef long long ll;
typedef long double ld;
const int mod = 1e9 + 7;
const ll inf = 3e18 + 5;
int add(int a, int b) { return (a += b) < mod ? a : a - mod; }
int mul(int a, int b) { return 1LL * a * b % mod; }
int sub(int a, int b) { return (a -= b) < 0 ? a + mod : a; }
int ctz(int x) { return __builtin_ctz(x); }
int clz(int x) { return __builtin_clz(x); }

int main(){
  ios_base::sync_with_stdio(false); cin.tie(0);
  #ifdef LOCAL
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
  #endif

  int n;
  cin >> n;
  string s;
  cin >> s;
  map<char, int> freq;
  for(char c : s){
      freq[c]++;
  }
  int np = 0;
  for(auto [i, j] : freq){
      np += (j % 2);
  }
  vi divs;
  for(ll i = 1; i * i <= n; i++){
      if(n % i == 0){
         divs.push_back(n / i);
         if(n / i != i){
             divs.push_back(i);
         }
      }
  }
  sort(all(divs));
  //cout << np << endl;
  for(int x : divs){
      //cout << x << endl;
      if((x - np) < 0 || ((x - np) % 2 == 1 && np > 0)) continue;
      if((n / x) % 2 == 0 && np > 0) continue;
      //cout << "proso " << x << endl;
      vector <string> res(x);
      vector <string> l(x);
      int j = 0;
      for(auto& [u, v] : freq){
          if(v % 2 == 1){
              v--;
              l[j++] += u;
              //res[j++].push_back(u);
          }
      }
      if((n / x) % 2 == 0) j = x;
      for(int i = j; i < x; i += 2){
          for(auto& [u, v] : freq){
              if(v >= 2 && (v % 2 == 0)){
                  v -= 2;
                  l[i] += u;
                  l[i + 1] += u;
                  //res[i].push_back(u);
                  //res[i + 1] = res[i];
                  break;
              }
          }
      }
      for(int i = 0; i < x; i++){
          // n / x - (n / x % 2)
          int cur = n / x - ((n / x) % 2);
          for(auto& [u, v] : freq){
              int mn = min(cur, v);
              cur -= mn;
              v -= mn;
              for(int k = 0; k < mn / 2; k++){
                  res[i].push_back(u);
                  //res[i].push_back(u);
              }
          }
          string a = res[i];
          reverse(all(a));
          if((n / x) % 2 == 1)
            res[i] += l[i];
          res[i] += a;
      }
      cout << x << "\n";
      for(auto& y : res){
          for(auto a : y){
              cout << a;
          }
          cout << " ";
      }
      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 <queue>
#include <bitset>
#include <stack>
#include <iomanip>
#define sig(x) ((x) < 0 ? -1 : 1)
using namespace std;
#define all(x) x.begin(), x.end()
typedef vector <int> vi;
typedef pair<int,int> ii;
typedef long long ll;
typedef long double ld;
const int mod = 1e9 + 7;
const ll inf = 3e18 + 5;
int add(int a, int b) { return (a += b) < mod ? a : a - mod; }
int mul(int a, int b) { return 1LL * a * b % mod; }
int sub(int a, int b) { return (a -= b) < 0 ? a + mod : a; }
int ctz(int x) { return __builtin_ctz(x); }
int clz(int x) { return __builtin_clz(x); }

int main(){
  ios_base::sync_with_stdio(false); cin.tie(0);
  #ifdef LOCAL
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
  #endif

  int n;
  cin >> n;
  string s;
  cin >> s;
  map<char, int> freq;
  for(char c : s){
      freq[c]++;
  }
  int np = 0;
  for(auto [i, j] : freq){
      np += (j % 2);
  }
  vi divs;
  for(ll i = 1; i * i <= n; i++){
      if(n % i == 0){
         divs.push_back(n / i);
         if(n / i != i){
             divs.push_back(i);
         }
      }
  }
  sort(all(divs));
  //cout << np << endl;
  for(int x : divs){
      //cout << x << endl;
      if((x - np) < 0 || ((x - np) % 2 == 1 && np > 0)) continue;
      if((n / x) % 2 == 0 && np > 0) continue;
      //cout << "proso " << x << endl;
      vector <string> res(x);
      vector <char> l(x);
      int j = 0;
      for(auto& [u, v] : freq){
          if(v % 2 == 1){
              v--;
              l[j++] = u;
              //res[j++].push_back(u);
          }
      }
      if((n / x) % 2 == 0) j = x;
      for(int i = j; i < x; i += 2){
          for(auto& [u, v] : freq){
              if(v >= 2 && (v % 2 == 0)){
                  v -= 2;
                  l[i] = u;
                  l[i + 1] = u;
                  //res[i].push_back(u);
                  //res[i + 1] = res[i];
              }
          }
      }
      for(int i = 0; i < x; i++){
          // n / x - (n / x % 2)
          int cur = n / x - ((n / x) % 2);
          for(auto& [u, v] : freq){
              int mn = min(cur, v);
              cur -= mn;
              v -= mn;
              for(int k = 0; k < mn / 2; k++){
                  res[i].push_back(u);
                  //res[i].push_back(u);
              }
          }
          string a = res[i];
          reverse(all(a));
          if((n / x) % 2 == 1)
            res[i] += l[i];
          res[i] += a;
      }
      cout << x << "\n";
      for(auto& y : res){
          for(auto a : y){
              cout << a;
          }
          cout << " ";
      }
      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 <queue>
#include <bitset>
#include <stack>
#include <iomanip>
#define sig(x) ((x) < 0 ? -1 : 1)
using namespace std;
#define all(x) x.begin(), x.end()
typedef vector <int> vi;
typedef pair<int,int> ii;
typedef long long ll;
typedef long double ld;
const int mod = 1e9 + 7;
const ll inf = 3e18 + 5;
int add(int a, int b) { return (a += b) < mod ? a : a - mod; }
int mul(int a, int b) { return 1LL * a * b % mod; }
int sub(int a, int b) { return (a -= b) < 0 ? a + mod : a; }
int ctz(int x) { return __builtin_ctz(x); }
int clz(int x) { return __builtin_clz(x); }

int main(){
  ios_base::sync_with_stdio(false); cin.tie(0);
  #ifdef LOCAL
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
  #endif

  int n;
  cin >> n;
  string s;
  cin >> s;
  map<char, int> freq;
  for(char c : s){
      freq[c]++;
  }
  int np = 0;
  for(auto [i, j] : freq){
      np += (j % 2);
  }
  vi divs;
  for(ll i = 1; i * i <= n; i++){
      if(n % i == 0){
         divs.push_back(n / i);
         if(n / i != i){
             divs.push_back(i);
         }
      }
  }
  sort(all(divs));
  //cout << np << endl;
  for(int x : divs){
      //cout << x << endl;
      if((x - np) < 0 || ((x - np) % 2 == 1 && np > 0)) continue;
      if((n / x) % 2 == 0 && np > 0) continue;
      //cout << "proso " << x << endl;
      vector<deque<char>> res(x);
      int j = 0;
      for(auto& [u, v] : freq){
          if(v % 2 == 1){
              v--;
              res[j++].push_back(u);
          }
      }
      if((n / x) % 2 == 0) j = x;
      for(int i = j; i < x; i += 2){
          for(auto& [u, v] : freq){
              if(v >= 2 && (v % 2 == 0)){
                  v -= 2;
                  res[i].push_back(u);
                  res[i + 1] = res[i];
              }
          }
      }
      for(int i = 0; i < x; i++){
          // n / x - (n / x % 2)
          int cur = n / x - ((n / x) % 2);
          for(auto& [u, v] : freq){
              int mn = min(cur, v);
              cur -= mn;
              v -= mn;
              for(int k = 0; k < mn / 2; k++){
                  res[i].push_front(u);
                  res[i].push_back(u);
              }
          }
      }
      cout << x << "\n";
      for(auto& y : res){
          for(auto a : y){
              cout << a;
          }
          cout << " ";
      }
      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 <queue>
#include <bitset>
#include <stack>
#include <iomanip>
#define sig(x) ((x) < 0 ? -1 : 1)
using namespace std;
#define all(x) x.begin(), x.end()
typedef vector <int> vi;
typedef pair<int,int> ii;
typedef long long ll;
typedef long double ld;
const int mod = 1e9 + 7;
const ll inf = 3e18 + 5;
int add(int a, int b) { return (a += b) < mod ? a : a - mod; }
int mul(int a, int b) { return 1LL * a * b % mod; }
int sub(int a, int b) { return (a -= b) < 0 ? a + mod : a; }
int ctz(int x) { return __builtin_ctz(x); }
int clz(int x) { return __builtin_clz(x); }

int main(){
  ios_base::sync_with_stdio(false); cin.tie(0);
  #ifdef LOCAL
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
  #endif

  int n;
  cin >> n;
  string s;
  cin >> s;
  map<char, int> freq;
  for(char c : s){
      freq[c]++;
  }
  int np = 0;
  for(auto [i, j] : freq){
      np += (j % 2);
  }
  vi divs;
  for(ll i = 1; i * i <= n; i++){
      if(n % i == 0){
         divs.push_back(n / i);
         if(n / i != i){
             divs.push_back(i);
         }
      }
  }
  sort(all(divs));
  //cout << np << endl;
  for(int x : divs){
      //cout << x << endl;
      if((x - np) < 0 || ((x - np) % 2 == 1 && np > 0)) continue;
      if((n / x) % 2 == 0 && np > 0) continue;
      //cout << "proso " << x << endl;
      vector <string> res(x);
      vector <char> l(x);
      int j = 0;
      for(auto& [u, v] : freq){
          if(v % 2 == 1){
              v--;
              l[j++] = u;
              //res[j++].push_back(u);
          }
      }
      if((n / x) % 2 == 0) j = x;
      for(int i = j; i < x; i += 2){
          for(auto& [u, v] : freq){
              if(v >= 2 && (v % 2 == 0)){
                  v -= 2;
                  l[i] = u;
                  l[i + 1] = u;
                  //res[i].push_back(u);
                  //res[i + 1] = res[i];
              }
          }
      }
      for(int i = 0; i < x; i++){
          // n / x - (n / x % 2)
          int cur = n / x - ((n / x) % 2);
          for(auto& [u, v] : freq){
              int mn = min(cur, v);
              cur -= mn;
              v -= mn;
              for(int k = 0; k < mn / 2; k++){
                  res[i].push_back(u);
                  //res[i].push_back(u);
              }
          }
          string a = res[i];
          reverse(all(a));
          res[i] += l[i];
          res[i] += a;
      }
      cout << x << "\n";
      for(auto& y : res){
          for(auto a : y){
              cout << a;
          }
          cout << " ";
      }
      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 <queue>
#include <bitset>
#include <stack>
#include <iomanip>
#define sig(x) ((x) < 0 ? -1 : 1)
using namespace std;
#define all(x) x.begin(), x.end()
typedef vector <int> vi;
typedef pair<int,int> ii;
typedef long long ll;
typedef long double ld;
const int mod = 1e9 + 7;
const ll inf = 3e18 + 5;
int add(int a, int b) { return (a += b) < mod ? a : a - mod; }
int mul(int a, int b) { return 1LL * a * b % mod; }
int sub(int a, int b) { return (a -= b) < 0 ? a + mod : a; }
int ctz(int x) { return __builtin_ctz(x); }
int clz(int x) { return __builtin_clz(x); }

int main(){
  ios_base::sync_with_stdio(false); cin.tie(0);
  #ifdef LOCAL
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
  #endif

  int n;
  cin >> n;
  string s;
  cin >> s;
  map<char, int> freq;
  for(char c : s){
      freq[c]++;
  }
  int np = 0;
  for(auto [i, j] : freq){
      np += (j % 2);
  }
  vi divs;
  for(ll i = 1; i * i <= n; i++){
      if(n % i == 0){
         divs.push_back(n / i);
         if(n / i != i){
             divs.push_back(i);
         }
      }
  }
  sort(all(divs));
  //cout << np << endl;
  for(int x : divs){
      //cout << x << endl;
      if((x - np) < 0 || ((x - np) % 2 == 1 && np > 0)) continue;
      if((n / x) % 2 == 0 && np > 0) continue;
      //cout << "proso " << x << endl;
      vector<deque<char>> res(x);
      int j = 0;
      for(auto& [u, v] : freq){
          if(v % 2 == 1){
              v--;
              res[j++].push_back(u);
          }
      }
      if((n / x) % 2 == 0) j = x;
      for(int i = j; i < x; i += 2){
          for(auto& [u, v] : freq){
              if(v >= 2 && (v % 2 == 0)){
                  v -= 2;
                  res[i].push_back(u);
                  res[i + 1] = res[i];
                  break;
              }
          }
      }

      for(int i = 0; i < x; i++){
          // n / x - (n / x % 2)
          int cur = n / x - res[i].size();
          for(auto& [u, v] : freq){
              int mn = min(cur, v);
              cur -= mn;
              v -= mn;
              if(mn > 0){
                  //cout << mn << " " << u << endl;
              }
              for(int k = 0; k < mn / 2; k++){
                  res[i].push_front(u);
                  res[i].push_back(u);
              }
          }
      }
      cout << x << "\n";
      for(auto& y : res){
          for(auto a : y){
              cout << a;
          }
          cout << " ";
      }
      return 0;
  }

}


#include <bits/stdc++.h>

using namespace std;

int n;
string s;
map<char, int> m;

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

  cin >> n >> s;
  for (auto e : s) m[e]++;
  int odd = 0;
  vector<pair<char, int>> ev;
  vector<pair<char, int>> od;
  for (auto e : m) {
    if (e.second & 1) {
      odd++;
      od.push_back(e);
    } else {
      ev.push_back(e);
    }
  }
  for (int i = 1; i <= n - 1; i++) {
    if (n % i == 0) {
      int part = n / i;
      if (part % 2 == 0 && odd == 0) {
        cout << i << '\n';
        int idx = 0;
        for (int j = 1; j <= i; j++) {
          string cur = "";
          int kk = part;
          while (kk > 0) {
            while (ev[idx].second == 0) idx++;
            cur.push_back(ev[idx].first);
            ev[idx].second -= 2;
            kk -= 2;
          }
          cout << cur;
          reverse(cur.begin(), cur.end());
          cout << cur;
          cout << (j == i ? '\n' : ' ');
        }
        return 0;
      } else if (part % 2 == 1 && odd <= i && (i - odd) % 2 == 0) {
        vector<char> middle(i + 3);
        for (int j = 1; j <= odd; j++) {
          middle[j] = od[j - 1].first;
          od[j - 1].second--;
        }
        for (auto e : od) if (e.second > 0) ev.push_back(e);
        priority_queue<pair<int, int>> pq;
        int len = ev.size();
        for (int j = 0; j < len; j++) {
          pq.push({ev[j].second, j});
        }
        int pos = odd + 1;
        while (pos <= i) {
          pair<int, int> curtop = pq.top();
          pq.pop();
          middle[pos] = middle[pos + 1] = ev[curtop.second].first;
          ev[curtop.second].second -= 2;
          pos += 2;
          curtop.first -= 2;
          if (curtop.first > 0) {
            pq.push(curtop);
          }
        }
        part--;
        cout << i << '\n';
        int idx = 0;
        for (int j = 1; j <= i; j++) {
          string cur = "";
          int kk = part;
          while (kk > 0) {
            while (ev[idx].second == 0) idx++;
            cur.push_back(ev[idx].first);
            ev[idx].second -= 2;
            kk -= 2;
          }
          cout << cur;
          reverse(cur.begin(), cur.end()); cout << middle[j];
          cout << cur;
          cout << (j == i ? '\n' : ' ');
        }
        return 0;
      }
    }
  }
  cout << n << '\n';
  for (int i = 0; i < n; i++) {
    cout << s[i] << (i == n - 1 ? '\n' : ' ');
  }

  return 0;
}


#include <bits/stdc++.h>

using namespace std;

int n;
string s;
map<char, int> m;

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

  cin >> n >> s;
  for (auto e : s) m[e]++;
  int odd = 0, even = 0;
  vector<pair<char, int>> ev;
  vector<pair<char, int>> od;
  for (auto e : m) {
    if (e.second & 1) {
      odd++;
      od.push_back(e);
    } else {
      even++;
      ev.push_back(e);
    }
  }
  for (int i = 1; i <= n - 1; i++) {
    if (n % i == 0) {
      int part = n / i;
      if (part % 2 == 0 && odd == 0) {
        cout << i << '\n';
        int idx = 0;
        for (int j = 1; j <= i; j++) {
          string cur = "";
          int kk = part;
          while (kk > 0) {
            while (ev[idx].second == 0) idx++;
            cur.push_back(ev[idx].first);
            ev[idx].second -= 2;
            kk -= 2;
          }
          cout << cur;
          reverse(cur.begin(), cur.end());
          cout << cur;
          cout << (j == i ? '\n' : ' ');
        }
        return 0;
      } else if (part % 2 == 1 && odd <= i && (i - odd) % 2 == 0) {
        vector<char> middle(i + 3);
        for (int j = 1; j <= odd; j++) {
          middle[j] = od[j - 1].first;
          od[j - 1].second--;
        }
        for (auto e : od) if (e.second > 0) ev.push_back(e);
        int len = ev.size();
        priority_queue<pair<int, int>> pq;
        for (int j = 0; j < len; j++) {
          pq.push({ev[j].second, j});
        }
        int pos = odd + 1;
        while (pos <= i) {
          pair<int, int> curtop = pq.top();
          pq.pop();
          middle[pos] = middle[pos + 1] = ev[curtop.second].first;
          pos += 2;
          curtop.first -= 2;
          if (curtop.first > 0) {
            pq.push(curtop);
          }
        }
        part--;
        cout << i << '\n';
        int idx = 0;
        for (int j = 1; j <= i; j++) {
          string cur = "";
          int kk = part;
          while (kk > 0) {
            while (ev[idx].second == 0) idx++;
            cur.push_back(ev[idx].first);
            ev[idx].second -= 2;
            kk -= 2;
          }
          cout << cur;
          reverse(cur.begin(), cur.end()); cout << middle[j];
          cout << cur;
          cout << (j == i ? '\n' : ' ');
        }
        return 0;
      }
    }
  }
  cout << n << '\n';
  for (int i = 0; i < n; i++) {
    cout << s[i] << (i == n - 1 ? '\n' : ' ');
  }

  return 0;
}


#include<bits/stdc++.h>
using namespace std;
int n;
int cnt,br[256];
string s;
void makepal(int len)
{
    string s1="";
    for(int i=0;i<256;i++)
    {
        if(br[i]%2==1)
        {
            s1+=char(i);
            br[i]--;
            break;
        }
    }
    if(s1=="")
    {
        for(int i=0;i<256;i++)
        {
            if(br[i]>0)
            {
                s1+=char(i);
                br[i]--;
                break;
            }
        }
    }
    for(int i=0;i<256;i++)
    {
        if(s1.size()==len)break;
        while(br[i]>0)
        {
            s1+=char(i);
            s1=char(i)+s1;
            br[i]-=2;
            if(s1.size()==len)break;
        }
    }
    cout<<s1<<endl;
}
int main()
{
    cin>>n;
    cin>>s;
    for(int i=0;i<s.size();i++)
    {
        br[s[i]]++;
    }
    for(int i=0;i<256;i++)
    {
        cnt+=br[i]%2;
    }
    if(cnt==0)
    {
        cout<<1<<endl;
        sort(s.begin(),s.end());
        for(int i=0;i<s.size();i+=2)
        {
            cout<<s[i];
        }
        for(int i=s.size()-1;i>=0;i-=2)
        {
            cout<<s[i];
        }
        cout<<endl;
        return 0;
    }
    cout<<cnt<<endl;
    //int ans=n;
    for(int i=1;i*i<=n;i++)
    {
        if(n%i!=0)continue;
        if((n/i)%2==1&&i>=cnt&&i%2==cnt%2&&i<ans)
        {
            ans=i;
        }
        if(i%2==1&&n/i>=cnt&&(n/i)%2==cnt%2&&n/i<ans)
        {
            ans=n/i;
        }
    }
    cout<<ans<<endl;
    for(int i=0;i<ans;i++)
    {
        makepal(n/ans);
    }
return 0;
}


#include<bits/stdc++.h>
using namespace std;
int n;
int cnt,br[256];
string s;
void makepal(int len)
{
    string s1="";
    for(int i=0;i<256;i++)
    {
        if(br[i]%2==1)
        {
            s1+=char(i);
            br[i]--;
            break;
        }
    }
    if(s1=="")
    {
        for(int i=0;i<256;i++)
        {
            if(br[i]>0)
            {
                s1+=char(i);
                br[i]--;
                break;
            }
        }
    }
    for(int i=0;i<256;i++)
    {
        if(s1.size()==len)break;
        while(br[i]>0)
        {
            s1+=char(i);
            s1=char(i)+s1;
            br[i]-=2;
            if(s1.size()==len)break;
        }
    }
    cout<<s1<<endl;
}
int main()
{
    cin>>n;
    cin>>s;
    for(int i=0;i<s.size();i++)
    {
        br[s[i]]++;
    }
    for(int i=0;i<256;i++)
    {
        cnt+=br[i]%2;
    }
    if(cnt==0)
    {
        cout<<1<<endl;
        sort(s.begin(),s.end());
        for(int i=0;i<s.size();i+=2)
        {
            cout<<s[i];
        }
        for(int i=s.size()-1;i>=0;i-=2)
        {
            cout<<s[i];
        }
        cout<<endl;
        return 0;
    }
    int ans=n;
    for(int i=1;i*i<=n;i++)
    {
        if(n%i!=0)continue;
        if((n/i)%2==1&&i>=cnt&&i%2==cnt%2&&i<ans)
        {
            ans=i;
        }
        if(i%2==1&&n/i>cnt&&(n/i)%2==cnt%2&&n/i<ans)
        {
            ans=n/i;
        }
    }
    cout<<ans<<endl;
    for(int i=0;i<ans;i++)
    {
        makepal(n/ans);
    }
return 0;
}


#include<bits/stdc++.h>
using namespace std;
int n;
int cnt,br[256];
string s;
void makepal(int len)
{
    string s1="";
    for(int i=0;i<256;i++)
    {
        if(br[i]%2==1)
        {
            s1+=char(i);
            br[i]--;
            break;
        }
    }
    if(s1=="")
    {
        for(int i=0;i<256;i++)
        {
            if(br[i]>0)
            {
                s1+=char(i);
                br[i]--;
                break;
            }
        }
    }
    for(int i=0;i<256;i++)
    {
        if(s1.size()==len)break;
        while(br[i]>0)
        {
            s1+=char(i);
            s1=char(i)+s1;
            if(s1.size()==len)break;
            br[i]-=2;
        }
    }
    cout<<s1<<endl;
}
int main()
{
    cin>>n;
    cin>>s;
    for(int i=0;i<s.size();i++)
    {
        br[s[i]]++;
    }
    for(int i=0;i<256;i++)
    {
        cnt+=br[i]%2;
    }
    if(cnt==0)
    {
        cout<<1<<endl;
        sort(s.begin(),s.end());
        for(int i=0;i<s.size();i+=2)
        {
            cout<<s[i];
        }
        for(int i=s.size()-1;i>=0;i-=2)
        {
            cout<<s[i];
        }
        cout<<endl;
        return 0;
    }
    int ans=n;
    for(int i=1;i*i<=n;i++)
    {
        if(n%i!=0)continue;
        if((n/i)%2==1&&i>=cnt&&i%2==cnt%2&&i<ans)
        {
            ans=i;
        }
        if(i%2==1&&n/i>cnt&&(n/i)%2==cnt%2&&n/i<ans)
        {
            ans=n/i;
        }
    }
    cout<<ans<<endl;
    for(int i=0;i<ans;i++)
    {
        makepal(n/ans);
    }
return 0;
}


#include<bits/stdc++.h>
using namespace std;
int n;
int cnt,br[256];
string s;
void makepal(int len)
{
    string s1="";
    for(int i=0;i<256;i++)
    {
        if(br[i]%2==1)
        {
            s1+=char(i);
            br[i]--;
            break;
        }
    }
    if(s1=="")
    {
        for(int i=0;i<256;i++)
        {
            if(br[i]>0)
            {
                s1+=char(i);
                br[i]--;
                break;
            }
        }
    }
    for(int i=0;i<256;i++)
    {
        if(s1.size()==len)break;
        while(br[i]>1)
        {
            s1+=char(i);
            s1=char(i)+s1;
            br[i]-=2;
            if(s1.size()==len)break;
        }
    }
    cout<<s1<<endl;
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    cin>>n;
    cin>>s;
    for(int i=0;i<s.size();i++)
    {
        br[s[i]]++;
    }
    for(int i=0;i<256;i++)
    {
        cnt+=br[i]%2;
    }
    if(cnt==0)
    {
        cout<<1<<endl;
        sort(s.begin(),s.end());
        for(int i=0;i<s.size();i+=2)
        {
            cout<<s[i];
        }
        for(int i=s.size()-1;i>=0;i-=2)
        {
            cout<<s[i];
        }
        cout<<endl;
        return 0;
    }
    //cout<<cnt<<endl;
    int ans=n;
    for(int i=1;i*i<=n;i++)
    {
        if(n%i!=0)continue;
        if((n/i)%2==1&&i>=cnt&&i%2==cnt%2&&i<ans)
        {
            ans=i;
        }
        if(i%2==1&&n/i>=cnt&&(n/i)%2==cnt%2&&n/i<ans)
        {
            ans=n/i;
        }
    }
    cout<<ans<<endl;
    for(int i=0;i<ans;i++)
    {
        makepal(n/ans);
    }
return 0;
}


#include<bits/stdc++.h>
using namespace std;
int n;
int cnt,br[256];
string s;
void makepal(int len)
{
    string s1="";
    for(int i=0;i<256;i++)
    {
        if(br[i]%2==1)
        {
            s1+=char(i);
            br[i]--;
            break;
        }
    }
    if(s1=="")
    {
        for(int i=0;i<256;i++)
        {
            if(br[i]>0)
            {
                s1+=char(i);
                br[i]--;
                break;
            }
        }
    }
    for(int i=0;i<256;i++)
    {
        if(s1.size()==len)break;
        while(br[i]>0)
        {
            s1+=char(i);
            s1=char(i)+s1;
            if(s1.size()==len)break;
            br[i]-=2;
        }
    }
    cout<<s1<<endl;
}
int main()
{
    cin>>n;
    cin>>s;
    for(int i=0;i<s.size();i++)
    {
        br[s[i]]++;
    }
    for(int i=0;i<256;i++)
    {
        if(br[i]%2==1)cnt++;
    }
    if(cnt==0)
    {
        cout<<1<<endl;
        sort(s.begin(),s.end());
        for(int i=0;i<s.size();i+=2)
        {
            cout<<s[i];
        }
        for(int i=s.size()-1;i>=0;i-=2)
        {
            cout<<s[i];
        }
        cout<<endl;
        return 0;
    }
    int ans=n;
    for(int i=1;i*i<=n;i++)
    {
        if(n%i!=0)continue;
        if(i>=cnt&&i%2==cnt%2&&i<ans)
        {
            ans=i;
        }
        if(n/i>cnt&&(n/i)%2==cnt%2&&n/i<ans)
        {
            ans=n/i;
        }
    }
    cout<<ans<<endl;
    for(int i=0;i<ans;i++)
    {
        makepal(n/ans);
    }
return 0;
}


#include<bits/stdc++.h>
using namespace std;
int n;
int cnt,br[256];
string s;
void makepal(int len)
{
    string s1="",s2="";
    for(int i=0;i<256;i++)
    {
        if(br[i]%2==1)
        {
            s1+=char(i);
            br[i]--;
            break;
        }
    }
    if(s1=="")
    {
        for(int i=0;i<256;i++)
        {
            if(br[i]>0)
            {
                s1+=char(i);
                br[i]--;
                break;
            }
        }
    }
    for(int i=0;i<256;i++)
    {
        if(s1.size()==len)break;
        while(br[i]>1)
        {
            s1+=char(i);
            s2+=char(i);
            br[i]-=2;
            if(s1.size()+s2.size()==len)break;
        }
    }
    reverse(s2.begin(),s2.end());
    cout<<s2<<s1<<endl;
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    cin>>n;
    cin>>s;
    for(int i=0;i<s.size();i++)
    {
        br[s[i]]++;
    }
    for(int i=0;i<256;i++)
    {
        cnt+=br[i]%2;
    }
    if(cnt==0)
    {
        cout<<1<<endl;
        sort(s.begin(),s.end());
        for(int i=0;i<s.size();i+=2)
        {
            cout<<s[i];
        }
        for(int i=s.size()-1;i>=0;i-=2)
        {
            cout<<s[i];
        }
        cout<<endl;
        return 0;
    }
    //cout<<cnt<<endl;
    int ans=n;
    for(int i=1;i*i<=n;i++)
    {
        if(n%i!=0)continue;
        if((n/i)%2==1&&i>=cnt&&i%2==cnt%2&&i<ans)
        {
            ans=i;
        }
        if(i%2==1&&n/i>=cnt&&(n/i)%2==cnt%2&&n/i<ans)
        {
            ans=n/i;
        }
    }
    cout<<ans<<endl;
    for(int i=0;i<ans;i++)
    {
        makepal(n/ans);
    }
return 0;
}


#include<bits/stdc++.h>
using namespace std;
int n;
int cnt,br[256];
string s;
void makepal(int len)
{
    string s1="",s2="";
    for(int i=0;i<256;i++)
    {
        if(br[i]%2==1)
        {
            s1+=char(i);
            br[i]--;
            break;
        }
    }
    if(s1=="")
    {
        for(int i=0;i<256;i++)
        {
            if(br[i]>0)
            {
                s1+=char(i);
                br[i]--;
                break;
            }
        }
    }
    for(int i=0;i<256;i++)
    {
        if(s1.size()+s2.size()==len)break;
        while(br[i]>1)
        {
            s1+=char(i);
            s2+=char(i);
            br[i]-=2;
            if(s1.size()+s2.size()==len)break;
        }
    }
    reverse(s2.begin(),s2.end());
    cout<<s2<<s1<<endl;
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    cin>>n;
    cin>>s;
    for(int i=0;i<s.size();i++)
    {
        br[s[i]]++;
    }
    for(int i=0;i<256;i++)
    {
        cnt+=br[i]%2;
    }
    if(cnt==0)
    {
        cout<<1<<endl;
        sort(s.begin(),s.end());
        for(int i=0;i<s.size();i+=2)
        {
            cout<<s[i];
        }
        for(int i=s.size()-1;i>=0;i-=2)
        {
            cout<<s[i];
        }
        cout<<endl;
        return 0;
    }
    //cout<<cnt<<endl;
    int ans=n;
    for(int i=1;i*i<=n;i++)
    {
        if(n%i!=0)continue;
        if((n/i)%2==1&&i>=cnt&&i%2==cnt%2&&i<ans)
        {
            ans=i;
        }
        if(i%2==1&&n/i>=cnt&&(n/i)%2==cnt%2&&n/i<ans)
        {
            ans=n/i;
        }
    }
    cout<<ans<<endl;
    for(int i=0;i<ans;i++)
    {
        makepal(n/ans);
    }
return 0;
}


#include<bits/stdc++.h>
using namespace std;
int n;
int cnt,br[256];
string s;
void makepal(int len)
{
    string s1="";
    for(int i=0;i<256;i++)
    {
        if(br[i]%2==1)
        {
            s1+=char(i);
            br[i]--;
            break;
        }
    }
    if(s1=="")
    {
        for(int i=0;i<256;i++)
        {
            if(br[i]>0)
            {
                s1+=char(i);
                br[i]--;
                break;
            }
        }
    }
    for(int i=0;i<256;i++)
    {
        if(s1.size()==len)break;
        while(br[i]>0)
        {
            s1+=char(i);
            s1=char(i)+s1;
            br[i]-=2;
            if(s1.size()==len)break;
        }
    }
    cout<<s1<<endl;
}
int main()
{
    cin>>n;
    cin>>s;
    for(int i=0;i<s.size();i++)
    {
        br[s[i]]++;
    }
    for(int i=0;i<256;i++)
    {
        cnt+=br[i]%2;
    }
    if(cnt==0)
    {
        cout<<1<<endl;
        sort(s.begin(),s.end());
        for(int i=0;i<s.size();i+=2)
        {
            cout<<s[i];
        }
        for(int i=s.size()-1;i>=0;i-=2)
        {
            cout<<s[i];
        }
        cout<<endl;
        return 0;
    }
    //cout<<cnt<<endl;
    int ans=n;
    for(int i=1;i*i<=n;i++)
    {
        if(n%i!=0)continue;
        if((n/i)%2==1&&i>=cnt&&i%2==cnt%2&&i<ans)
        {
            ans=i;
        }
        if(i%2==1&&n/i>=cnt&&(n/i)%2==cnt%2&&n/i<ans)
        {
            ans=n/i;
        }
    }
    cout<<ans<<endl;
    for(int i=0;i<ans;i++)
    {
        makepal(n/ans);
    }
return 0;
}


#include<bits/stdc++.h>
using namespace std;
int n;
int cnt,br[256];
string s;
void makepal(int len)
{
    string s1="";
    for(int i=0;i<256;i++)
    {
        if(br[i]%2==1)
        {
            s1+=char(i);
            br[i]--;
            break;
        }
    }
    if(s1=="")
    {
        for(int i=0;i<256;i++)
        {
            if(br[i]>0)
            {
                s1+=char(i);
                br[i]--;
                break;
            }
        }
    }
    for(int i=0;i<256;i++)
    {
        if(s1.size()==len)break;
        while(br[i]>1)
        {
            s1+=char(i);
            s1=char(i)+s1;
            br[i]-=2;
            if(s1.size()==len)break;
        }
    }
    cout<<s1<<endl;
}
int main()
{
    cin>>n;
    cin>>s;
    for(int i=0;i<s.size();i++)
    {
        br[s[i]]++;
    }
    for(int i=0;i<256;i++)
    {
        cnt+=br[i]%2;
    }
    if(cnt==0)
    {
        cout<<1<<endl;
        sort(s.begin(),s.end());
        for(int i=0;i<s.size();i+=2)
        {
            cout<<s[i];
        }
        for(int i=s.size()-1;i>=0;i-=2)
        {
            cout<<s[i];
        }
        cout<<endl;
        return 0;
    }
    //cout<<cnt<<endl;
    int ans=n;
    for(int i=1;i*i<=n;i++)
    {
        if(n%i!=0)continue;
        if((n/i)%2==1&&i>=cnt&&i%2==cnt%2&&i<ans)
        {
            ans=i;
        }
        if(i%2==1&&n/i>=cnt&&(n/i)%2==cnt%2&&n/i<ans)
        {
            ans=n/i;
        }
    }
    cout<<ans<<endl;
    for(int i=0;i<ans;i++)
    {
        makepal(n/ans);
    }
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());
    puts("1");
    int m = even.size();
    FOR(i, 0, m) {putchar(even[i]);}
    FORD(i, m - 1, 0) {putchar(even[i]);}
    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);}
  }
}

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;
    }
    //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);}
  }
}

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>
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 n; string s;
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() {
  preprocess();
  cin >> n >> s;
  for (char &ch : s) {cnt[(int)ch]++;}
  pairing('a', 'z'), pairing('A', 'Z'), pairing('0', '9');
  int a = odd.size(), b = even.size();
  if (a == 0) {
    cout << 1 << endl;
    string res = "";
    for (char &ch : even) {res = ch + res + ch;}
    cout << res << endl;
  } else if (b % a == 0) {
    cout << a << endl;
    int m = b / a;
    int id = 0;
    for (char &ch : odd) {
      string t = "";
      t += ch;
      FOR(i, 0, m) {
        char c = even[id++];
        t = c + t + c;
      }
      cout << t << ' ';
    }
    cout << endl;
  } else {
    cout << -1 << endl;
  }
  // 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 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 n; string s;
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() {
  preprocess();
  cin >> n >> s;
  for (char &ch : s) {cnt[(int)ch]++;}
  pairing('a', 'z'), pairing('A', 'Z'), pairing('0', '9');
  if (odd.empty()) {
    cout << 1 << endl;
    string res = "";
    for (char &ch : even) {res = ch + res + ch;}
    cout << res << endl; 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;
  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;
    }
    cout << t << ' ';
  }
  cout << endl;
  // 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;
}