#include<bits/stdc++.h>

using namespace std;

#define LL long long
#define mod 1000000007
#define N 100005

pair<int,int> a[N];

int main()
{
    int n,h,i,x,y;

    scanf("%d%d",&n,&h);
    for(i=0;i<n;i++)
    {
        scanf("%d",&a[i].first);
        a[i].second = i;
    }
    sort(a,a+n);
    int t1,t2;

    if(n==2)
        printf("1 1");
    else
    {
        x = a[n-1].first+a[n-2].first;
        y = a[0].first+a[1].first;

        t1 = x-y;

        x = max(x,a[n-1].first+a[0].first+h);
        y = min(y+h,a[1].first+a[2].first);

        t2 = max(x,y)-min(x,y);

        printf("%d\n",min(t1,t2));
        if(t1<t2)
            for(i=0;i<n;i++)
                printf("1 ");
        else
            for(i=0;i<n;i++)
                if(a[0].second==i)
                    printf("1 ");
                else
                    printf("2 ");
    }
    return 0;
}


#include<bits/stdc++.h>

using namespace std;

#define LL long long
#define mod 1000000007
#define N 100005

pair<int,int> a[N];

int main()
{
    int n,h,i,x,y;

    scanf("%d%d",&n,&h);
    for(i=0;i<n;i++)
    {
        scanf("%d",&a[i].first);
        a[i].second = i;
    }
    sort(a,a+n);
    int t1,t2;

    if(n==2)
        printf("0\n1 1");
    else
    {
        x = a[n-1].first+a[n-2].first;
        y = a[0].first+a[1].first;

        t1 = x-y;

        x = max(x,a[n-1].first+a[0].first+h);
        y = min(y+h,a[1].first+a[2].first);

        t2 = max(x,y)-min(x,y);

        printf("%d\n",min(t1,t2));
        if(t1<t2)
            for(i=0;i<n;i++)
                printf("1 ");
        else
            for(i=0;i<n;i++)
                if(a[0].second==i)
                    printf("1 ");
                else
                    printf("2 ");
    }
    return 0;
}


#include <stdio.h>
#include <iostream>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <vector>
#include <string>
#include <cstring>
#include <math.h>
#include <algorithm>
#include <complex>
#include <ctime>
#include <iomanip>
#include <cassert>
#include <sstream>
#include <iterator>

using namespace std;

#define file "file"
#define mp make_pair
#define pb push_back
#define xx real()
#define yy imag()
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef complex<double> point;

const int MAXN = 1e5 + 5;
const int INF = 1e12;

pair<int,int> a[MAXN];
int res[MAXN];

void solve(){
    int n,h,v;
    scanf("%d%d",&n,&h);
    for(int i = 0;i < n;i++){
        scanf("%d",&v);
        a[i] = mp(v,i);
    }
    sort(a,a + n);
    reverse(a,a + n);
    ll ans = a[0].first + a[1].first - (a[n - 1].first + a[n - 2].first);
    if(n > 2){
        if(a[1].first > a[n - 1].first + h){
            if(a[n - 3].first < a[n - 1].first + h){
                if(ans > a[0].first + a[1].first - a[n - 2].first - a[n - 3].first){
                    ans = a[0].first + a[1].first - a[n - 2].first - a[n - 3].first;
                    res[a[n - 1].second] = 1;
                }
            }
            else{
                if(ans > a[0].first + a[1].first - a[n - 2].first - a[n - 1].first - h){
                    ans = a[0].first + a[1].first - a[n - 2].first - a[n - 1].first - h;
                    res[a[n - 1].second] = 1;
                }
            }
        }
        else{
            if(a[n - 3].first < a[n - 1].first + h){
                if(ans > a[0].first + a[n - 1].first + h - a[n - 2].first - a[n - 3].first){
                    ans = a[0].first + a[n - 1].first + h - a[n - 2].first - a[n - 3].first;
                    res[a[n - 1].first] = 1;
                }
            }
            else{
                if(ans > a[0].first + a[n - 1].first + h - a[n - 2].first - a[n - 1].first - h){
                    ans = a[0].first + a[n - 1].first + h - a[n - 2].first - a[n - 1].first - h;
                    res[a[n - 1].first] = 1;
                }
            }
        }
    }
    printf("%I64d\n",ans);
    for(int i = 0;i < n;i++){
        printf("%d ",res[i] + 1);
    }
}

int main()
{
	#ifndef ONLINE_JUDGE
    assert(freopen("input.txt","r",stdin));
    assert(freopen("output.txt","w",stdout));
    #else
    //assert(freopen(file".in","r",stdin)); assert(freopen(file".out","w",stdout));
    #endif
	int t = 1;
	while(t--){
		solve();
	}
	return 0;
}


#include <stdio.h>
#include <iostream>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <vector>
#include <string>
#include <cstring>
#include <math.h>
#include <algorithm>
#include <complex>
#include <ctime>
#include <iomanip>
#include <cassert>
#include <sstream>
#include <iterator>

using namespace std;

#define file "file"
#define mp make_pair
#define pb push_back
#define xx real()
#define yy imag()
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef complex<double> point;

const int MAXN = 1e5 + 5;
const ll INF = 1e12;

pair<int,int> a[MAXN];
int res[MAXN];

void solve(){
    int n,h,v;
    scanf("%d%d",&n,&h);
    for(int i = 0;i < n;i++){
        scanf("%d",&v);
        a[i] = mp(v,i);
    }
    sort(a,a + n);
    reverse(a,a + n);
    ll ans = a[0].first + a[1].first - (a[n - 1].first + a[n - 2].first);
    if(n > 2){
        if(a[1].first > a[n - 1].first + h){
            if(a[n - 3].first < a[n - 1].first + h){
                if(ans > a[0].first + a[1].first - a[n - 2].first - a[n - 3].first){
                    ans = a[0].first + a[1].first - a[n - 2].first - a[n - 3].first;
                    res[a[n - 1].second] = 1;
                }
            }
            else{
                if(ans > a[0].first + a[1].first - a[n - 2].first - a[n - 1].first - h){
                    ans = a[0].first + a[1].first - a[n - 2].first - a[n - 1].first - h;
                    res[a[n - 1].second] = 1;
                }
            }
        }
        else{
            if(a[n - 3].first < a[n - 1].first + h){
                if(ans > a[0].first + a[n - 1].first + h - a[n - 2].first - a[n - 3].first){
                    ans = a[0].first + a[n - 1].first + h - a[n - 2].first - a[n - 3].first;
                    res[a[n - 1].second] = 1;
                }
            }
            else{
                if(ans > a[0].first + a[n - 1].first + h - a[n - 2].first - a[n - 1].first - h){
                    ans = a[0].first + a[n - 1].first + h - a[n - 2].first - a[n - 1].first - h;
                    res[a[n - 1].second] = 1;
                }
            }
        }
    }
    printf("%I64d\n",ans);
    for(int i = 0;i < n;i++){
        printf("%d ",res[i] + 1);
    }
}

int main()
{
	#ifndef ONLINE_JUDGE
    assert(freopen("input.txt","r",stdin));
    assert(freopen("output.txt","w",stdout));
    #else
    //assert(freopen(file".in","r",stdin)); assert(freopen(file".out","w",stdout));
    #endif
	int t = 1;
	while(t--){
		solve();
	}
	return 0;
}


#include <stdio.h>
#include <iostream>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <vector>
#include <string>
#include <cstring>
#include <math.h>
#include <algorithm>
#include <complex>
#include <ctime>
#include <iomanip>
#include <cassert>
#include <sstream>
#include <iterator>

using namespace std;

#define file "file"
#define mp make_pair
#define pb push_back
#define xx real()
#define yy imag()
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef complex<double> point;

const int MAXN = 1e5 + 5;
const int INF = 1e12;

pair<int,int> a[MAXN];
int res[MAXN];

void solve(){
    int n,h,v;
    scanf("%d%d",&n,&h);
    for(int i = 0;i < n;i++){
        scanf("%d",&v);
        a[i] = mp(v,i);
    }
    sort(a,a + n);
    reverse(a,a + n);
    ll ans = a[0].first + a[1].first - (a[n - 1].first + a[n - 2].first);
    if(n > 2){
        if(a[1].first > a[n - 1].first + h){
            if(a[n - 3].first < a[n - 1].first + h){
                if(ans > a[0].first + a[1].first - a[n - 2].first - a[n - 3].first){
                    ans = a[0].first + a[1].first - a[n - 2].first - a[n - 3].first;
                    res[a[n - 1].second] = 1;
                }
            }
            else{
                if(ans > a[0].first + a[1].first - a[n - 2].first - a[n - 1].first - h){
                    ans = a[0].first + a[1].first - a[n - 2].first - a[n - 1].first - h;
                    res[a[n - 1].second] = 1;
                }
            }
        }
        else{
            if(a[n - 3].first < a[n - 1].first + h){
                if(ans > a[0].first + a[n - 1].first + h - a[n - 2].first - a[n - 3].first){
                    ans = a[0].first + a[n - 1].first + h - a[n - 2].first - a[n - 3].first;
                    res[a[n - 1].second] = 1;
                }
            }
            else{
                if(ans > a[0].first + a[n - 1].first + h - a[n - 2].first - a[n - 1].first - h){
                    ans = a[0].first + a[n - 1].first + h - a[n - 2].first - a[n - 1].first - h;
                    res[a[n - 1].second] = 1;
                }
            }
        }
    }
    printf("%I64d\n",ans);
    for(int i = 0;i < n;i++){
        printf("%d ",res[i] + 1);
    }
}

int main()
{
	#ifndef ONLINE_JUDGE
    assert(freopen("input.txt","r",stdin));
    assert(freopen("output.txt","w",stdout));
    #else
    //assert(freopen(file".in","r",stdin)); assert(freopen(file".out","w",stdout));
    #endif
	int t = 1;
	while(t--){
		solve();
	}
	return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>
#define uint long long int
#define N 1000007
using namespace std;
int t[N];
int main()
{
    ios_base::sync_with_stdio(0);
    int n, h;
    cin>>n>>h;
    for(int i=1; i<=n; i++)
    {
        cin>>t[i];
    }
    sort(t+1, t+1+n);
    int ktory=0;
    int f1=t[n]+t[n-1]-(t[1]+t[2]);
    int maxi=max(t[n]+t[1]+h, t[n]+t[n-1]);
    int mini=min(t[2]+t[3], t[1]+t[2]+h);
    if(f1>maxi-mini)
    {
        cout<<maxi-mini<<endl;
        cout<<"1 ";
        for(int i=1; i<=n-1; i++)
        {
            cout<<"2 ";
        }
        cout<<endl;
    }
    else
    {
        cout<<f1<<endl;
        for(int i=1; i<=n; i++)
        {
            cout<<"1 ";
        }
        cout<<endl;
    }
    //system("pause");
    return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>
#define uint long long int
#define N 1000007
using namespace std;
int t[N];
int main()
{
    ios_base::sync_with_stdio(0);
    int n, h;
    cin>>n>>h;
    for(int i=1; i<=n; i++)
    {
        cin>>t[i];
    }
    sort(t+1, t+1+n);
    int ktory=0;
    int f1=t[n]+t[n-1]-(t[1]+t[2]);
    int maxi=max(t[n]+t[1]+h, t[n]+t[n-1]);
    int mini=min(t[2]+t[3], t[1]+t[2]+h);
    if(f1>maxi-mini || n>2)
    {
        cout<<maxi-mini<<endl;
        cout<<"1 ";
        for(int i=1; i<=n-1; i++)
        {
            cout<<"2 ";
        }
        cout<<endl;
    }
    else
    {
        cout<<f1<<endl;
        for(int i=1; i<=n; i++)
        {
            cout<<"1 ";
        }
        cout<<endl;
    }
    system("pause");
    return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>
#define uint long long int
#define N 1000007
using namespace std;
int t[N];
int main()
{
    ios_base::sync_with_stdio(0);
    int n, h;
    cin>>n>>h;
    for(int i=1; i<=n; i++)
    {
        cin>>t[i];
    }
    sort(t+1, t+1+n);
    int ktory=0;
    int f1=t[n]+t[n-1]-(t[1]+t[2]);
    int maxi=max(t[n]+t[1]+h, t[n]+t[n-1]);
    int mini=min(t[2]+t[3], t[1]+t[2]+h);
    if(f1>maxi-mini && n>2)
    {
        cout<<maxi-mini<<endl;
        cout<<"1 ";
        for(int i=1; i<=n-1; i++)
        {
            cout<<"2 ";
        }
        cout<<endl;
    }
    else
    {
        cout<<f1<<endl;
        for(int i=1; i<=n; i++)
        {
            cout<<"1 ";
        }
        cout<<endl;
    }
    // system("pause");
    return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>
#define uint long long int
#define N 1000007
using namespace std;
int a[N];
int t[N];
int main()
{
    ios_base::sync_with_stdio(0);
    int n, h;
    cin>>n>>h;
    for(int i=1; i<=n; i++)
    {
        cin>>a[i];
        t[i]=a[i];
       // cin>>t[i];
    }
    sort(t+1, t+1+n);
    int ktory=0;
    int f1=t[n]+t[n-1]-(t[1]+t[2]);
    int maxi=max(t[n]+t[1]+h, t[n]+t[n-1]);
    int mini=min(t[2]+t[3], t[1]+t[2]+h);
    int najm=0;
    a[0]=1001*1001*1001;
    for(int i=1; i<=n; i++)
    {
        if(a[i]<a[najm])
        {
            najm=i;
        }
    }
    if(f1>maxi-mini && n>2)
    {
        cout<<maxi-mini<<endl;
        for(int i=1; i<=n; i++)
        {
            if(i==najm)
            {
                cout<<"1 ";
            }
            else
            {
                cout<<"2 ";
            }
        }
        cout<<endl;
    }
    else
    {
        cout<<f1<<endl;
        for(int i=1; i<=n; i++)
        {
            cout<<"1 ";
        }
        cout<<endl;
    }
    //system("pause");
    return 0;
}
/*
3 2
2 1 3
*/


#include <algorithm>
#include <functional>
#include <numeric>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cstring>
#include <cassert>
#include <string>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <sstream>
using namespace std;

#define LL long long
#define LD long double
#define PR pair<int,int>

#define For(i,n) for (i=0; i<int(n); i++)
#define For1(i,n) for (i=1; i<=int(n); i++)
#define ForR(i,n) for (i=int(n)-1; i>=0; i--)
#define ForR1(i,n) for (i=int(n); i>0; i--)
#define Sz(s) int((s).size())
#define All(s) (s).begin(),(s).end()
#define Fill(s,v) memset(s,v,sizeof(s))
#define pb push_back
#define mp make_pair
#define x first
#define y second

template<typename T> T Abs(T x) { return(x < 0 ? -x : x); }
template<typename T> T Sqr(T x) { return(x*x); }

const int INF = (int)1e9;
const LD EPS = 1e-9;
const LD PI = acos(-1.0);

#define DEBUG 0

int main()
{
		if (DEBUG)
			freopen("in.txt","r",stdin);
	//vars
	int N,H;
	int i,g1,g2;
	static int nums[100000];
	//input
	scanf("%d%d",&N,&H);
		For(i,N)
			scanf("%d",&nums[i]);
	//find current goodness
	sort(nums,nums+N);
	g1=(nums[N-1]+nums[N-2])-(nums[0]+nums[1]);
	//consider moving the first guy to a different sequence
		if (N>=3)
		{
			g2=max(nums[0]+nums[N-1]+H,nums[N-1]+nums[N-2])-min(nums[0]+nums[1]+H,nums[1]+nums[2]);
				if (g2<g1)
				{
					//worth it!
					printf("%d\n",g2);
						For(i,N)
							printf("%d%c",(i?2:1),((i<N-1)?' ':'\n'));
					return(0);
				}
		}
	//change nothing
	printf("%d\n",g1);
		For(i,N)
			printf("%d%c",1,((i<N-1)?' ':'\n'));
	return(0);
}


#include <algorithm>
#include <functional>
#include <numeric>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cstring>
#include <cassert>
#include <string>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <sstream>
using namespace std;

#define LL long long
#define LD long double
#define PR pair<int,int>

#define For(i,n) for (i=0; i<int(n); i++)
#define For1(i,n) for (i=1; i<=int(n); i++)
#define ForR(i,n) for (i=int(n)-1; i>=0; i--)
#define ForR1(i,n) for (i=int(n); i>0; i--)
#define Sz(s) int((s).size())
#define All(s) (s).begin(),(s).end()
#define Fill(s,v) memset(s,v,sizeof(s))
#define pb push_back
#define mp make_pair
#define x first
#define y second

template<typename T> T Abs(T x) { return(x < 0 ? -x : x); }
template<typename T> T Sqr(T x) { return(x*x); }

const int INF = (int)1e9;
const LD EPS = 1e-9;
const LD PI = acos(-1.0);

#define DEBUG 0

int main()
{
		if (DEBUG)
			freopen("in.txt","r",stdin);
	//vars
	int N,H;
	int i,g1,g2;
	static int nums[100000];
	//input
	scanf("%d%d",&N,&H);
		For(i,N)
			scanf("%d",&nums[i]);
	//find current goodness
	sort(nums,nums+N);
	g1=(nums[N-1]+nums[N-2])-(nums[0]+nums[1]);
	//consider moving the first guy to a different sequence
		if (N>=3)
		{
			g2=max(nums[0]+nums[N-1]+H,nums[N-1]+nums[N-2])-(nums[1]+nums[2]);
				if (g2<g1)
				{
					//worth it!
					printf("%d\n",g2);
						For(i,N)
							printf("%d%c",(i?2:1),((i<N-1)?' ':'\n'));
					return(0);
				}
		}
	//change nothing
	printf("%d\n",g1);
		For(i,N)
			printf("%d%c",1,((i<N-1)?' ':'\n'));
	return(0);
}


#include <algorithm>
#include <functional>
#include <numeric>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cstring>
#include <cassert>
#include <string>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <sstream>
using namespace std;

#define LL long long
#define LD long double
#define PR pair<int,int>

#define For(i,n) for (i=0; i<int(n); i++)
#define For1(i,n) for (i=1; i<=int(n); i++)
#define ForR(i,n) for (i=int(n)-1; i>=0; i--)
#define ForR1(i,n) for (i=int(n); i>0; i--)
#define Sz(s) int((s).size())
#define All(s) (s).begin(),(s).end()
#define Fill(s,v) memset(s,v,sizeof(s))
#define pb push_back
#define mp make_pair
#define x first
#define y second

template<typename T> T Abs(T x) { return(x < 0 ? -x : x); }
template<typename T> T Sqr(T x) { return(x*x); }

const int INF = (int)1e9;
const LD EPS = 1e-9;
const LD PI = acos(-1.0);

#define DEBUG 0

int main()
{
		if (DEBUG)
			freopen("in.txt","r",stdin);
	//vars
	int N,H;
	int i,g1,g2,mi,mv;
	static int nums[100000];
	//input
	scanf("%d%d",&N,&H);
		For(i,N)
		{
			scanf("%d",&nums[i]);
				if ((!i) || (nums[i]<mv))
					mv=nums[i],mi=i;
		}
	//find current goodness
	sort(nums,nums+N);
	g1=(nums[N-1]+nums[N-2])-(nums[0]+nums[1]);
	//consider moving the first guy to a different sequence
		if (N>=3)
		{
			g2=max(nums[0]+nums[N-1]+H,nums[N-1]+nums[N-2])-min(nums[0]+nums[1]+H,nums[1]+nums[2]);
				if (g2<g1)
				{
					//worth it!
					printf("%d\n",g2);
						For(i,N)
							printf("%d%c",(i==mi?2:1),((i<N-1)?' ':'\n'));
					return(0);
				}
		}
	//change nothing
	printf("%d\n",g1);
		For(i,N)
			printf("%d%c",1,((i<N-1)?' ':'\n'));
	return(0);
}


#include <iostream>
#include <algorithm>
#define ll long long
#define P pair <ll, ll>
#define x first
#define y second
using namespace std;
P a[100001];
ll plc[100001];

ll DDD(ll a0, ll a1, ll a2, ll a3){
	ll mn = min(a0, a1);
	ll mx = max(a0, a1);

	mx = max(mx, max(a2, a3));
	mn = min(mn, min(a2, a3));

	return mx - mn;
}

int main(){
	ll n, h;
	cin >> n >> h;
	for (int i = 0;i < n;++i){
		cin >> a[i].x;
		a[i].y = i;
	}

	sort(a, a + n);
	ll up = a[n - 1].x + a[n - 2].x, dif = up - (a[0].x + a[1].x), mod = 0;

	for (int i = 2;i < n - 1;++i){
		ll ans = DDD(up, a[0].x + a[i].x, a[0].x + a[1].x + h, a[i - 1].x + a[n - 1].x + h);
		if (ans < dif){
			dif = ans;
			mod = i;
		}
	}
	ll ans = 0;
	if (n == 3) ans = DDD(a[n - 1].x + a[n - 2].x, a[1].x + a[2].x, a[0].x + a[1].x + h, a[0].x + a[n - 1].x + h);
	else ans = DDD(a[0].x + a[1].x + h, a[0].x + a[1].x + h, a[0].x + a[1].x + h, a[0].x + a[n - 1].x + h);
	if (ans < dif){
		dif = ans;
		mod = n;
	}

	plc[a[0].y] = 1;
	for (int i = 1;i < mod;++i) plc[a[i].y] = 2;
	for (int i = mod;i < n;++i) plc[a[i].y] = 1;

	cout << dif << endl;
	for (int i = 0;i < n;++i)
		cout << (i ? " " : "") << plc[i];
	cout << endl;
	return 0;
}


#include <iostream>
#include <algorithm>
#define ll long long
#define P pair <ll, ll>
#define x first
#define y second
using namespace std;
P a[100001];
ll plc[100001];

ll DDD(ll a0, ll a1, ll a2, ll a3, ll a4){
	ll mn = min(a0, a1);
	ll mx = max(a0, a1);

	mx = max(mx, max(a2, a3));
	mn = min(mn, min(a2, a3));

	return mx - mn;
}

int main(){
	ll n, h;
	cin >> n >> h;
	for (int i = 0;i < n;++i){
		cin >> a[i].x;
		a[i].y = i;
	}

	sort(a, a + n);
	ll up = a[n - 1].x + a[n - 2].x, dw = a[0].x + a[1].x;
	ll dif = up - (a[0].x + a[1].x), mod = 0;

	for (int i = 2;i < n - 1;++i){
		ll mx = max(a[i - 1].x + a[n - 1].x + h, up);
		ll mn = min(a[0].x + a[i].x, dw + h);
		if (i != 2)	mn = min(mn, a[1].x + a[2].x);
		if (mx - mn < dif){
			dif = mx - mn;
			mod = i;
		}
	}
	ll ans = 0;
	if (n >= 3) {
		ll mx = max(up, a[0].x + a[n - 1].x + h);
		ll mn = min(a[1].x + a[2].x, dw + h);
		ans = mx - mn;
	}

	if (ans < dif){
		dif = ans;
		mod = n;
	}

	plc[a[0].y] = 1;
	for (int i = 1;i < mod;++i) plc[a[i].y] = 2;
	for (int i = mod;i < n;++i) plc[a[i].y] = 1;

	cout << dif << endl;
	for (int i = 0;i < n;++i)
		cout << (i ? " " : "") << plc[i];
	cout << endl;
	return 0;
}


#include <iostream>
#include <algorithm>
#define ll long long
#define P pair <ll, ll>
#define x first
#define y second
using namespace std;
P a[100001];
ll plc[100001];

ll DDD(ll a0, ll a1, ll a2, ll a3){
	ll mn = min(a0, a1);
	ll mx = max(a0, a1);

	mx = max(mx, max(a2, a3));
	mn = min(mn, min(a2, a3));

	return mx - mn;
}

int main(){
	ll n, h;
	cin >> n >> h;
	for (int i = 0;i < n;++i){
		cin >> a[i].x;
		a[i].y = i;
	}

	sort(a, a + n);
	ll up = a[n - 1].x + a[n - 2].x, dif = up - (a[0].x + a[1].x), mod = 0;

	for (int i = 2;i < n - 1;++i){
		ll ans = DDD(up, a[0].x + a[i].x, a[0].x + a[1].x + h, a[i - 1].x + a[n - 1].x + h);
		if (ans < dif){
			dif = ans;
			mod = i;
		}
	}
	ll ans = 0;
	if (n >= 3) ans = DDD(a[n - 1].x + a[n - 2].x, a[1].x + a[2].x, a[0].x + a[1].x + h, a[0].x + a[n - 1].x + h);
	else ans = DDD(a[0].x + a[1].x + h, a[0].x + a[1].x + h, a[0].x + a[1].x + h, a[0].x + a[n - 1].x + h);
	if (ans < dif){
		dif = ans;
		mod = n;
	}

	plc[a[0].y] = 1;
	for (int i = 1;i < mod;++i) plc[a[i].y] = 2;
	for (int i = mod;i < n;++i) plc[a[i].y] = 1;

	cout << dif << endl;
	for (int i = 0;i < n;++i)
		cout << (i ? " " : "") << plc[i];
	cout << endl;
	return 0;
}


#include <iostream>
#include <algorithm>
#define ll long long
#define P pair <ll, ll>
#define x first
#define y second
using namespace std;
P a[100001];
ll plc[100001];

ll DDD(ll a0, ll a1, ll a2, ll a3){
	ll mn = min(a0, a1);
	ll mx = max(a0, a1);

	mx = max(mx, max(a2, a3));
	mn = min(mn, min(a2, a3));

	return mx - mn;
}

int main(){
	ll n, h;
	cin >> n >> h;
	for (int i = 0;i < n;++i){
		cin >> a[i].x;
		a[i].y = i;
	}

	sort(a, a + n);
	ll up = a[n - 1].x + a[n - 2].x, dif = up - (a[0].x + a[1].x), mod = 0;

	for (int i = 2;i < n - 1;++i){
		ll ans = DDD(up, a[0].x + a[i].x, a[0].x + a[1].x + h, a[i - 1].x + a[n - 1].x + h);
		if (ans < dif){
			dif = ans;
			mod = i;
		}
	}

	ll ans = DDD(up, up, a[0].x + a[1].x + h, a[0].x + a[n - 1].x + h);
	if (ans < dif){
		dif = ans;
		mod = n;
	}

	plc[a[0].y] = 1;
	for (int i = 1;i < mod;++i) plc[a[i].y] = 2;
	for (int i = mod;i < n;++i) plc[a[i].y] = 1;

	cout << dif << endl;
	for (int i = 0;i < n;++i)
		cout << (i ? " " : "") << plc[i];
	cout << endl;
	return 0;
}


#include <iostream>
#include <algorithm>
#define ll long long
#define P pair <ll, ll>
#define x first
#define y second
using namespace std;
P a[100001];
ll plc[100001];

ll DDD(ll a0, ll a1, ll a2, ll a3, ll a4){
	ll mn = min(a0, a1);
	ll mx = max(a0, a1);

	mx = max(mx, max(a2, a3));
	mn = min(mn, min(a2, a3));

	return mx - mn;
}

int main(){
	ll n, h;
	cin >> n >> h;
	for (int i = 0;i < n;++i){
		cin >> a[i].x;
		a[i].y = i;
	}

	sort(a, a + n);
	ll up = a[n - 1].x + a[n - 2].x, dw = a[0].x + a[1].x;
	ll dif = up - (a[0].x + a[1].x), mod = 0;

	/*for (int i = 2;i < n - 1;++i){
		ll mx = max(a[i - 1].x + a[n - 1].x + h, up);
		ll mn = min(a[0].x + a[i].x, dw + h);
		if (i != 2)	mn = min(mn, a[1].x + a[2].x);
		if (mx - mn < dif){
			dif = mx - mn;
			mod = i;
		}
	}*/
	ll ans = 0;
	if (n >= 3) {
		ll mx = max(up, a[0].x + a[n - 1].x + h);
		ll mn = min(a[1].x + a[2].x, dw + h);
		ans = mx - mn;
	}

	if (ans < dif){
		dif = ans;
		mod = n;
	}

	plc[a[0].y] = 1;
	for (int i = 1;i < mod;++i) plc[a[i].y] = 2;
	for (int i = mod;i < n;++i) plc[a[i].y] = 1;

	cout << dif << endl;
	for (int i = 0;i < n;++i)
		cout << (i ? " " : "") << plc[i];
	cout << endl;
	return 0;
}


// In the name of ALLAH

#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;

#define MP make_pair
#define X first
#define Y second
typedef pair<int,int> pii;
const int MAX = 100*100+7;
pii a[MAX];
int h, n;

int main() {
	cin >> n >> h;
	for (int i=0; i<n; i++) {
		cin >> a[i].X;
		a[i].Y = i;
	}
	if (n == 2) {
		cout << 0 << endl;
		for (int i=0; i<n; i++)
			cout << 1 << " ";
		cout << endl;
		return 0;
	}

	sort(a,a+n);
	int ans = 1000*1000*1000, ansW = 0;
	ans = (a[n-1].X + a[n-2].X) - (a[0].X + a[1].X);
//	cerr << ans << endl;
	if (max(a[n-1].X+a[0].X+h, a[n-1].X+a[n-2].X) - min((a[1].X + a[2].X), a[0].X+a[1].X+h) < ans) {
		cout << max(a[n-1].X + a[0].X + h, a[n-1].X + a[n-2].X) - min((a[1].X + a[2].X), a[0].X+a[1].X+h) << endl;
		for (int i=0; i<n; i++)
			if (i != a[0].Y)
				cout << 1 << " ";
			else
				cout << 2 << " ";
		cout << endl;
	}
	else {
		cout << ans << endl;
		for (int i=0; i<n; i++)
			cout << 1 << " ";
		cout << endl;
	}
	return 0;
}


// In the name of ALLAH

#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;

#define MP make_pair
#define X first
#define Y second
typedef pair<int,int> pii;
const int MAX = 100*1000+7;
pii a[MAX];
int h, n;

int main() {
	cin >> n >> h;
	for (int i=0; i<n; i++) {
		cin >> a[i].X;
		a[i].Y = i;
	}
	if (n == 2) {
		cout << 0 << endl;
		for (int i=0; i<n; i++)
			cout << 1 << " ";
		cout << endl;
		return 0;
	}

	sort(a,a+n);
	int ans = 1000*1000*1000, ansW = 0;
	ans = (a[n-1].X + a[n-2].X) - (a[0].X + a[1].X);
//	cerr << ans << endl;
	if (max(a[n-1].X+a[0].X+h, a[n-1].X+a[n-2].X) - min((a[1].X + a[2].X), a[0].X+a[1].X+h) < ans) {
		cout << max(a[n-1].X + a[0].X + h, a[n-1].X + a[n-2].X) - min((a[1].X + a[2].X), a[0].X+a[1].X+h) << endl;
		for (int i=0; i<n; i++)
			if (i != a[0].Y)
				cout << 1 << " ";
			else
				cout << 2 << " ";
		cout << endl;
	}
	else {
		cout << ans << endl;
		for (int i=0; i<n; i++)
			cout << 1 << " ";
		cout << endl;
	}
	return 0;
}


// In the name of ALLAH

#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;

#define MP make_pair
#define X first
#define Y second
typedef pair<int,int> pii;
const int MAX = 100*100+7;
pii a[MAX];
int h, n;

int main() {
	cin >> n >> h;
	for (int i=0; i<n; i++) {
		cin >> a[i].X;
		a[i].Y = i;
	}
	if (n == 2) {
		cout << 0 << endl;
		for (int i=0; i<n; i++)
			cout << 1 << " ";
		cout << endl;
	}

	sort(a,a+n);
	int ans = 1000*1000*1000, ansW = 0;
	ans = (a[n-1].X + a[n-2].X) - (a[0].X + a[1].X);
//	cerr << ans << endl;
	if (max(a[n-1].X+a[0].X+h, a[n-1].X+a[n-2].X) - min((a[1].X + a[2].X), a[0].X+a[1].X+h) < ans) {
		cout << max(a[n-1].X + a[0].X + h, a[n-1].X + a[n-2].X) - min((a[1].X + a[2].X), a[0].X+a[1].X+h) << endl;
		for (int i=0; i<n; i++)
			if (i != a[0].Y)
				cout << 1 << " ";
			else
				cout << 2 << " ";
		cout << endl;
	}
	else {
		cout << ans << endl;
		for (int i=0; i<n; i++)
			cout << 1 << " ";
		cout << endl;
	}
	return 0;
}


// In the name of ALLAH

#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;

#define MP make_pair
#define X first
#define Y second
typedef pair<int,int> pii;
const int MAX = 100*100+7;
pii a[MAX];
int h, n;

int main() {
	cin >> n >> h;
	for (int i=0; i<n; i++) {
		cin >> a[i].X;
		a[i].Y = i;
	}
	if (n == 2) {
		cout << 0 << endl;
		for (int i=0; i<n; i++)
			cout << 1 << " ";
		cout << endl;
	}

	sort(a,a+n);
	int ans = 1000*1000*1000, ansW = 0;
	ans = (a[n-1].X + a[n-2].X) - (a[0].X+a[1].X);
	if (max(a[n-1].X+a[0].X+h, a[n-1].X+a[n-2].X) - (a[1].X + a[2].X) < ans) {
		cout << max(a[n-1].X + a[0].X + h, a[n-1].X + a[n-2].X) - (a[1].X + a[2].X) << endl;
		for (int i=0; i<n; i++)
			if (i != a[0].Y)
				cout << 1 << " ";
			else
				cout << 2 << " ";
		cout << endl;
	}
	else {
		cout << ans << endl;
		for (int i=0; i<n; i++)
			cout << 1 << " ";
		cout << endl;
	}
	return 0;
}


#include<cstdio>
#include<vector>
#include<queue>
#include<algorithm>
#include<set>
#include<stack>
#include<cmath>
#include <map>
#include<iostream>
#include<cstdlib>
#include<cstring>
#include<string>
#include<cassert>
using namespace std;

#define DEBUG //on-off switch for prlling statements

// Input macros
#define s(n)                        scanf("%d",&n)
#define sc(n)                       scanf("%c",&n)
#define sl(n)                       scanf("%lld",&n)
#define sf(n)                       scanf("%lf",&n)
#define ss(n)                       scanf("%s",n)

// Useful constants
#define EPS                         1e-10

// Useful hardware instructions
#define bitcount1                    __builtin_popcount1
#define gcd                         __gcd

// Useful container manipulation / traversal macros
#define forall(i,a,b)               for(ll i=a;i<b;i++)
#define foreach(v, c)               for( typeof( (c).begin()) v = (c).begin();  v != (c).end(); ++v)
#define all(a)                      a.begin(), a.end()
#define in(a,b)                     ( (b).find(a) != (b).end())
#define pb                          push_back
#define fill(a,v)                    memset(a, v, sizeof a)
#define sz(a)                       ((ll)(a.size()))

// Some common useful functions
#define miN(a,b)                     ( (a) < (b) ? (a) : (b))
#define maX(a,b)                     ( (a) > (b) ? (a) : (b))

#define ll long long int
#define llu long long unsigned
#define ld long
#define INF 100000000000000000

#define mod 1000000007
#define F first
#define S second
typedef struct type
{
	int val;
	int idx;
}type;
int compare(const type& a,const type& b)
{
	if(a.val  == b.val)
	return a.idx < b.idx;
	return a.val<b.val;
}
type a[100001];
int ans[100001];

int main()
{
	int n,h;
	s(n);
	s(h);
	for(int i=0;i<n;i++)
	{
		s(a[i].val);
		a[i].idx=i;
	}
	sort(a,a+n,compare);
	ll ans1=((a[n-1].val+a[n-2].val) - (a[0].val+a[1].val));
	ll max1=max(a[n-1].val+a[n-2].val,a[n-1].val+a[0].val+h);

	ll min1=min(a[n-1].val+a[0].val+h,a[1].val+a[2].val);
	ll val1=max1-min1;
	if(ans1 < val1)
	{
		for(int i=0;i<n;i++)
		{
			ans[i]=1;
		}
	}
	else
	{
		for(int i=0;i<n;i++)
		ans[i]=1;
		ans[a[0].idx]=2;
	}
	for(int i=0;i<n;i++)
	printf("%d ",ans[i]);
	printf("\n");

}


#include<cstdio>
#include<vector>
#include<queue>
#include<algorithm>
#include<set>
#include<stack>
#include<cmath>
#include <map>
#include<iostream>
#include<cstdlib>
#include<cstring>
#include<string>
#include<cassert>
using namespace std;

#define DEBUG //on-off switch for prlling statements

// Input macros
#define s(n)                        scanf("%d",&n)
#define sc(n)                       scanf("%c",&n)
#define sl(n)                       scanf("%lld",&n)
#define sf(n)                       scanf("%lf",&n)
#define ss(n)                       scanf("%s",n)

// Useful constants
#define EPS                         1e-10

// Useful hardware instructions
#define bitcount1                    __builtin_popcount1
#define gcd                         __gcd

// Useful container manipulation / traversal macros
#define forall(i,a,b)               for(ll i=a;i<b;i++)
#define foreach(v, c)               for( typeof( (c).begin()) v = (c).begin();  v != (c).end(); ++v)
#define all(a)                      a.begin(), a.end()
#define in(a,b)                     ( (b).find(a) != (b).end())
#define pb                          push_back
#define fill(a,v)                    memset(a, v, sizeof a)
#define sz(a)                       ((ll)(a.size()))

// Some common useful functions
#define miN(a,b)                     ( (a) < (b) ? (a) : (b))
#define maX(a,b)                     ( (a) > (b) ? (a) : (b))

#define ll long long int
#define llu long long unsigned
#define ld long
#define INF 100000000000000000

#define mod 1000000007
#define F first
#define S second
typedef struct type
{
	int val;
	int idx;
}type;
int compare(const type& a,const type& b)
{
	if(a.val  == b.val)
	return a.idx < b.idx;
	return a.val<b.val;
}
type a[100001];
int ans[100001];

int main()
{
	int n,h;
	s(n);
	s(h);
	for(int i=0;i<n;i++)
	{
		s(a[i].val);
		a[i].idx=i;
	}
	if(n == 2)
	{
		printf("1 1\n");
		return 0;
	}
	sort(a,a+n,compare);
	ll ans1=((a[n-1].val+a[n-2].val) - (a[0].val+a[1].val));
	ll max1=max(a[n-1].val+a[n-2].val,a[n-1].val+a[0].val+h);

	ll min1=min(a[n-1].val+a[0].val+h,a[1].val+a[2].val);
	ll val1=max1-min1;
	if(ans1 < val1)
	{
		for(int i=0;i<n;i++)
		{
			ans[i]=1;
		}
	}
	else
	{
		for(int i=0;i<n;i++)
		ans[i]=1;
		ans[a[0].idx]=2;
	}
	for(int i=0;i<n;i++)
	printf("%d ",ans[i]);
	printf("\n");

}


#include<cstdio>
#include<vector>
#include<queue>
#include<algorithm>
#include<set>
#include<stack>
#include<cmath>
#include <map>
#include<iostream>
#include<cstdlib>
#include<cstring>
#include<string>
#include<cassert>
using namespace std;

#define DEBUG //on-off switch for prlling statements

// Input macros
#define s(n)                        scanf("%d",&n)
#define sc(n)                       scanf("%c",&n)
#define sl(n)                       scanf("%lld",&n)
#define sf(n)                       scanf("%lf",&n)
#define ss(n)                       scanf("%s",n)

// Useful constants
#define EPS                         1e-10

// Useful hardware instructions
#define bitcount1                    __builtin_popcount1
#define gcd                         __gcd

// Useful container manipulation / traversal macros
#define forall(i,a,b)               for(ll i=a;i<b;i++)
#define foreach(v, c)               for( typeof( (c).begin()) v = (c).begin();  v != (c).end(); ++v)
#define all(a)                      a.begin(), a.end()
#define in(a,b)                     ( (b).find(a) != (b).end())
#define pb                          push_back
#define fill(a,v)                    memset(a, v, sizeof a)
#define sz(a)                       ((ll)(a.size()))

// Some common useful functions
#define miN(a,b)                     ( (a) < (b) ? (a) : (b))
#define maX(a,b)                     ( (a) > (b) ? (a) : (b))

#define ll long long int
#define llu long long unsigned
#define ld long
#define INF 100000000000000000

#define mod 1000000007
#define F first
#define S second
typedef struct type
{
    int val;
    int idx;
}type;
int compare(const type& a,const type& b)
{
    if(a.val  == b.val)
    return a.idx < b.idx;
    return a.val<b.val;
}
type a[100001];
int ans[100001];

int main()
{
    int n,h;
    s(n);
    s(h);
    for(int i=0;i<n;i++)
    {
        s(a[i].val);
        a[i].idx=i;
    }
    if(n == 2)
    {
        printf("0\n");
        printf("1 1\n");
        return 0;
    }
    sort(a,a+n,compare);
    ll ans1=((a[n-1].val+a[n-2].val) - (a[0].val+a[1].val));
    ll max1=max(a[n-1].val+a[n-2].val,a[n-1].val+a[0].val+h);

    ll min1=min(a[1].val+a[0].val+h,a[1].val+a[2].val);
    ll val1=max1-min1;

    if(ans1 < val1)
    {
        for(int i=0;i<n;i++)
        {
            ans[i]=1;
        }
    }
    else
    {
        for(int i=0;i<n;i++)
        ans[i]=1;
        ans[a[0].idx]=2;
    }
    printf("%lld\n",min(ans1,val1));
    for(int i=0;i<n;i++)
    printf("%d ",ans[i]);
    printf("\n");

}


#include<cstdio>
#include<vector>
#include<queue>
#include<algorithm>
#include<set>
#include<stack>
#include<cmath>
#include <map>
#include<iostream>
#include<cstdlib>
#include<cstring>
#include<string>
#include<cassert>
using namespace std;

#define DEBUG //on-off switch for prlling statements

// Input macros
#define s(n)                        scanf("%d",&n)
#define sc(n)                       scanf("%c",&n)
#define sl(n)                       scanf("%lld",&n)
#define sf(n)                       scanf("%lf",&n)
#define ss(n)                       scanf("%s",n)

// Useful constants
#define EPS                         1e-10

// Useful hardware instructions
#define bitcount1                    __builtin_popcount1
#define gcd                         __gcd

// Useful container manipulation / traversal macros
#define forall(i,a,b)               for(ll i=a;i<b;i++)
#define foreach(v, c)               for( typeof( (c).begin()) v = (c).begin();  v != (c).end(); ++v)
#define all(a)                      a.begin(), a.end()
#define in(a,b)                     ( (b).find(a) != (b).end())
#define pb                          push_back
#define fill(a,v)                    memset(a, v, sizeof a)
#define sz(a)                       ((ll)(a.size()))

// Some common useful functions
#define miN(a,b)                     ( (a) < (b) ? (a) : (b))
#define maX(a,b)                     ( (a) > (b) ? (a) : (b))

#define ll long long int
#define llu long long unsigned
#define ld long
#define INF 100000000000000000

#define mod 1000000007
#define F first
#define S second
typedef struct type
{
	int val;
	int idx;
}type;
int compare(const type& a,const type& b)
{
	if(a.val  == b.val)
	return a.idx < b.idx;
	return a.val<b.val;
}
type a[100001];
int ans[100001];

int main()
{
	int n,h;
	s(n);
	s(h);
	for(int i=0;i<n;i++)
	{
		s(a[i].val);
		a[i].idx=i;
	}
	if(n == 2)
	{
		printf("0\n");
		printf("1 1\n");
		return 0;
	}
	sort(a,a+n,compare);
	ll ans1=((a[n-1].val+a[n-2].val) - (a[0].val+a[1].val));
	ll max1=max(a[n-1].val+a[n-2].val,a[n-1].val+a[0].val+h);

	ll min1=min(a[n-1].val+a[0].val+h,a[1].val+a[2].val);
	ll val1=max1-min1;

	if(ans1 < val1)
	{
		for(int i=0;i<n;i++)
		{
			ans[i]=1;
		}
	}
	else
	{
		for(int i=0;i<n;i++)
		ans[i]=1;
		ans[a[0].idx]=2;
	}
	printf("%lld\n",min(ans1,val1));
	for(int i=0;i<n;i++)
	printf("%d ",ans[i]);
	printf("\n");

}


#include <stdio.h>
#include <ctype.h>
#include <iostream>
#include <math.h>
#include <string.h>
#include <algorithm>
#include <stdlib.h>
#include <time.h>
#include <queue>
#include <set>
#include <map>
#include <string>
#include <vector>
#include <utility>
#include <assert.h>

#define MPI 3.141592653589793238462643
#define eps 1e-8
#define inf ((int)1e9)
#define pb push_back
#define mp make_pair

using namespace std;

pair <int, int> A[11000];

int main()
{
  int n, i, h;
  //freopen(".in", "r", stdin);
  //freopen(".out", "w", stdout);
  scanf("%d%d", &n, &h);
  if (n==2)
  {
    printf("0\n1 1\n");
    return 0;
  }
  for (i=0; i<n; i++)
    scanf("%d", &A[i].first), A[i].second=i;
  sort(A,A+n);
  reverse(A,A+n);
  int f1=(A[0].first+A[1].first)-(A[n-2].first+A[n-1].first);
  int f2=max(A[0].first+A[1].first,A[0].first+A[n-1].first+h)-min(A[n-1].first+A[n-2].first+h,A[n-2].first+A[n-3].first);
  if (f1<f2)
  {
    printf("%d\n", f1);
    for (i=0; i<n; i++)
      printf("1 ");
    printf("\n");
    return 0;
  }
    printf("%d\n", f2);
    for (i=0; i<n; i++)
      (A[n-1].second==i)?(printf("2 ")):(printf("1 "));
    printf("\n");

  return 0;
}


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

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

	string s;
	cin >> s;
	int size = s.size();
	int r = size%20, d = size/20, cols[5];
	int i, j, k;

	for(i = 0; i < 5; i++) cols[i] = 0;

	for(i = 0; i < d; i++) {
		cols[i] = 20;
	}
	cols[i] = r;

	if(!i) {
		cout << "1 " << r << endl << s << endl;
		return 0;
	} else if(r) {
		j = 0;
		while(cols[j] && j < 5) {
			cols[j] = size/(i+1);
			if(j < size%(i+1)) cols[j]++;
			j++;
		}
	}
	if(!r) d--;

	int col = max(cols[0], cols[1]), pos = 0;
	j = 0;
	cout << d+1 << ' ' << cols[0] << endl;
	while(cols[j] > 0 && j < 5) {
		if(cols[j] < col) cout << "*";
		for(k = 0; k < cols[j]; k++) {
			cout << s[pos++];
		} cout << endl;
		j++; if(j == d+1) break;
	}
}


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

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

	string s;
	cin >> s;
	int size = s.size();
	int r = size%20, d = size/20, cols[5];
	int i, j, k;

	for(i = 0; i < 5; i++) cols[i] = 0;

	for(i = 0; i < d; i++) {
		cols[i] = 20;
	}
	cols[i] = r;

	if(!i) {
		cout << "1 " << r << endl << s << endl;
		return 0;
	} else if(r) {
		j = 0;
		while(cols[j] && j < 5) {
			cols[j] = size/(i+1);
			if(j < size%(i+1)) cols[j]++;
			j++;
			if(j == d+1) break;
		}
	}
	if(!r) d--;

	int col = max(cols[0], cols[1]), pos = 0;
	j = 0;
	cout << d+1 << ' ' << cols[0] << endl;
	while(cols[j] > 0 && j < 5) {
		if(cols[j] < col) cout << "*";
		for(k = 0; k < cols[j]; k++) {
			cout << s[pos++];
		} cout << endl;
		j++;
		if(j == d+1) break;
	}
}


#include<bits/stdc++.h>
#define ll 	     long long
#define pb          push_back
#define all(a)      (a).begin(),(a).end()
#define	endl        '\n'
#define vi          vector<int>
#define len(s)       s.length()
#define rep(i,a,b)  for(int i=a;i<b;i++)
#define bs          binary_search
using namespace std;
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	string s;
	cin>>s;
	int a=len(s),x;
	if(a%20==0)
	x=a/20;
	else
	x=a/20+1;
	int y;
	y=a%x==0?a/x:a/x+1;
	int t=x*y-a,p=0,v=0;
	cout<<x<<" "<<y<<endl;
	if(x==1)
	{cout<<s;return 0;}
	rep(j,0,x)
	{  if(t!=0)
	   {
	       cout<<"*";
	       t--;

	       if(j>0)
	       p=1;
	       rep(i,0,y-1)
	       cout<<s[i+j*y-p];

	   }
	   else

	   {if(p==1)
	    v=1;
	       rep(i,0,y)
	       cout<<s[i+j*y-1-v];

	   }

	   cout<<endl;

	}
}


#include<bits/stdc++.h>
#define ll 	     long long
#define pb          push_back
#define all(a)      (a).begin(),(a).end()
#define	endl        '\n'
#define vi          vector<int>
#define len(s)       s.length()
#define rep(i,a,b)  for(int i=a;i<b;i++)
#define bs          binary_search
using namespace std;
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	string s;
	cin>>s;
	int a=len(s),x;
	if(a%20==0)
	x=a/20;
	else
	x=a/20+1;
	int y;
	y=a%x==0?a/x:a/x+1;
	int t=x*y-a,p=0,v=0;
	rep(j,0,x)
	{  if(t!=0)
	   {
	       cout<<"*";
	       t--;

	       if(j>0)
	       p=1;
	       rep(i,0,y-1)
	       cout<<s[i+j*y-p];

	   }
	   else

	   {if(p==1)
	    v=1;
	       rep(i,0,y)
	       cout<<s[i+j*y-1-v];

	   }

	   cout<<endl;

	}
}


#include<bits/stdc++.h>
#define ll 	     long long
#define pb          push_back
#define all(a)      (a).begin(),(a).end()
#define	endl        '\n'
#define vi          vector<int>
#define len(s)       s.length()
#define rep(i,a,b)  for(int i=a;i<b;i++)
#define bs          binary_search
using namespace std;
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	string s;
	cin>>s;
	int a=len(s),x;
	if(a%20==0)
	x=a/20;
	else
	x=a/20+1;
	int y;
	y=a%x==0?a/x:a/x+1;
	int t=x*y-a,p=0,v=0;
	cout<<x<<" "<<y<<endl;
	if(x==1)
	{cout<<s;return 0;}
	if(t==0)
	rep(j,0,x)
	{rep(i,0,y)
	       cout<<s[i+j*y];
	       cout<<endl;}
	if(t!=0)
	rep(j,0,x)
	{  if(t!=0)
	   {
	       cout<<"*";
	       t--;

	       if(j>0)
	       p=1;
	       rep(i,0,y-1)
	       cout<<s[i+j*y-p];

	   }
	   else

	   {if(p==1)
	    v=1;
	       rep(i,0,y)
	       cout<<s[i+j*y-1-v];

	   }

	   cout<<endl;

	}
}


#include<bits/stdc++.h>
#define ll 	     long long
#define pb          push_back
#define all(a)      (a).begin(),(a).end()
#define	endl        '\n'
#define vi          vector<int>
#define len(s)       s.length()
#define rep(i,a,b)  for(int i=a;i<b;i++)
#define bs          binary_search
using namespace std;
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	string s,s2;
	s2="*";
	cin>>s;
	int a=len(s),x;
	if(a%20==0)
	x=a/20;
	else
	x=a/20+1;
	int y;
	y=a%x==0?a/x:a/x+1;
	int t=x*y-a,p=0,v=0;
	cout<<x<<" "<<y<<endl;
	rep(i,0,t)
    s.insert(y*i+3,s2);
    rep(i,0,x)
    {rep(j,0,y)
    cout<<s[j+i*y];
    cout<<endl;}

}


#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define mx 1000007
ll a[mx+3],n,i,j,prime[mx+7];
string s;
map<ll,ll>mi;
map<char,ll>mc;
map<string,ll>ms;
void seive()
{
    ll x=sqrt(mx);
    for(int i=2;i<=mx;i+=2) prime[i]=2;
    for(int i=3;i<=mx;i+=2)  prime[i]=i;
    for(int i=3;i<=x;i+=2){
        if(prime[i]==i){
            for(int j=i*i;j<=mx;j+=i){
                if(prime[j]==j) prime[j]=i;
            }
        }
    }
}
/*void seive()
{
    ll x;
    x=sqrt(mx);
    for(ll i=4;i<=mx;i+=2) prime[i]=1;
    for(ll i=3;i<=x;i+=2){
        if(prime[i]==0){
            for(ll j=i*i;j<=mx;j+=i) prime[j]=1;
        }
    }
}*/
int main()
{
    //seive();
    cin>>s;
    ll n=s.size();
    ll low=0,hi=100;
    ll mid;
    ll i=1;
    ll x=0;
    for(int j=0;j<100;j++){
        mid=n/i;
        ll ok=0;
        string c;
        if(mid<=20){

            //cout<<mid<<endl;
            if(n%mid==0){
                cout<<n/mid<<" "<<mid<<endl;
                for(int i=1;i<=n;i++){
                    cout<<s[i-1];
                    if(i%mid==0) cout<<endl;
                }
            }
            else {
                while(n%i!=0) {
                    n++;
                    ok=1;
                    x++;
                }
                mid=n/i;
                cout<<n/mid<<" "<<mid<<endl;
                for(int i=1;i<=n;i++){

                    c+=s[i-1];
                    if(c.size()%mid==0 &&  ok==1 && x>0) {
                        for(int k=0;k<c.size()-1;k++) cout<<c[k];
                        cout<<"*";
                        cout<<endl;
                        x--;
                        c=c[c.size()-1];
                    }
                    else if(c.size()%mid==0) {
                        cout<<c<<endl;
                        c="";

                    }
                }
                //cout<<"*"<<endl;
            }
            break;
        }
        else i++;
    }

}


#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define mx 1000007
ll a[mx+3],n,i,j,prime[mx+7];
string s;
map<ll,ll>mi;
map<char,ll>mc;
map<string,ll>ms;
void seive()
{
    ll x=sqrt(mx);
    for(int i=2;i<=mx;i+=2) prime[i]=2;
    for(int i=3;i<=mx;i+=2)  prime[i]=i;
    for(int i=3;i<=x;i+=2){
        if(prime[i]==i){
            for(int j=i*i;j<=mx;j+=i){
                if(prime[j]==j) prime[j]=i;
            }
        }
    }
}
/*void seive()
{
    ll x;
    x=sqrt(mx);
    for(ll i=4;i<=mx;i+=2) prime[i]=1;
    for(ll i=3;i<=x;i+=2){
        if(prime[i]==0){
            for(ll j=i*i;j<=mx;j+=i) prime[j]=1;
        }
    }
}*/
int main()
{
    //seive();
    cin>>s;
    ll n=s.size();
    ll low=0,hi=100;
    ll mid;
    ll i=1;
    ll x=0;
    for(int j=0;j<100;j++){
        mid=n/i;
        ll ok=0;
        string c;
        if(mid<=20){

            //cout<<mid<<endl;
            if(n%mid==0){
                cout<<n/mid<<" "<<mid<<endl;
                for(int i=1;i<=n;i++){
                    cout<<s[i-1];
                    if(i%mid==0) cout<<endl;
                }
            }
            else {
                while(n%i!=0) {
                    n++;
                    ok=1;
                    x++;
                }
                mid=n/i;
                while(mid>20){
                    mid=n/i;
                    i++;
                }
                if(mid>20) {
                    mid=n/i;

                }
                cout<<n/mid<<" "<<mid<<endl;
                for(int i=1;i<=n;i++){

                    c+=s[i-1];
                    if(c.size()%mid==0 &&  ok==1 && x>0) {
                        for(int k=0;k<c.size()-1;k++) cout<<c[k];
                        cout<<"*";
                        cout<<endl;
                        x--;
                        c=c[c.size()-1];
                    }
                    else if(c.size()%mid==0) {
                        cout<<c<<endl;
                        c="";

                    }
                }
                //cout<<"*"<<endl;
            }
            break;
        }
        else i++;
    }

}


#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define mx 1000007
ll a[mx+3],n,i,j,prime[mx+7];
string s;
map<ll,ll>mi;
map<char,ll>mc;
map<string,ll>ms;
void seive()
{
    ll x=sqrt(mx);
    for(int i=2;i<=mx;i+=2) prime[i]=2;
    for(int i=3;i<=mx;i+=2)  prime[i]=i;
    for(int i=3;i<=x;i+=2){
        if(prime[i]==i){
            for(int j=i*i;j<=mx;j+=i){
                if(prime[j]==j) prime[j]=i;
            }
        }
    }
}
/*void seive()
{
    ll x;
    x=sqrt(mx);
    for(ll i=4;i<=mx;i+=2) prime[i]=1;
    for(ll i=3;i<=x;i+=2){
        if(prime[i]==0){
            for(ll j=i*i;j<=mx;j+=i) prime[j]=1;
        }
    }
}*/
int main()
{
    //seive();
    cin>>s;
    ll n=s.size();
    //cout<<n<<endl;
    ll low=0,hi=100;
    ll mid;
    ll i=1;
    ll x=0;
    for(int j=0;j<100;j++){
        mid=n/i;
        ll ok=0;
        string c;
        if(mid<=20){

            //cout<<mid<<endl;
            if(n%mid==0){
                cout<<n/mid<<" "<<mid<<endl;
                for(int i=1;i<=n;i++){
                    cout<<s[i-1];
                    if(i%mid==0) cout<<endl;
                }
            }
            else {
                while(n%i!=0) {
                    n++;
                    if(n%i==0 && n/i>20) i++;
                    ok=1;
                    x++;
                }
                //cout<<n<<endl;
                mid=n/i;
                //cout<<mid<<endl;
                while(mid>20){
                    mid=n/i;
                    i++;
                }
                //cout<<i<<" "<<mid<<endl;
                if(mid>20) {
                    mid=n/i;

                }
                cout<<n/mid<<" "<<mid<<endl;
                for(int i=1;i<=n;i++){

                    c+=s[i-1];
                    if(c.size()%mid==0 &&  ok==1 && x>0) {
                        for(int k=0;k<c.size()-1;k++) cout<<c[k];
                        cout<<"*";
                        cout<<endl;
                        x--;
                        c=c[c.size()-1];
                    }
                    else if(c.size()%mid==0) {
                        cout<<c<<endl;
                        c="";

                    }
                }
                //cout<<"*"<<endl;
            }
            break;
        }
        else i++;
    }

}


#include <bits/stdc++.h>

using namespace std ;

int q , n , m , x , el , w ;
string s ;

int main (){
	cin >> s ;
	x = s.size() ;
	int h = 1 ;
	while ((x+h-1)/h > 20){
		h++ ;
	}
	cout << h << " " << (x+h-1)/h;
	el = (x+h-1)/h - x/h ;
	cout << '\n';
	for(int i = 1 ; i < h ; i++){
		for(int j = 0 ; j < el / h ; j++){
			cout << '*' ;
			q++ ;
		}
		for(int j = 0 ; j < (x+h-1)/h - el / h ;j++){
			cout << s[w] ;
			w++ ;
		}
		cout << '\n' ;
	}
	for(int i = 0 ; i < el -q ;i++){
		cout << '*' ;
	}
	for(int i = w ; i < x ;i++){
		cout << s[i] ;
	}
	return 0 ;
}


#include <bits/stdc++.h>

using namespace std ;

int q , n , m , x , el , w ;
string s ;

int main (){
	cin >> s ;
	x = s.size() ;
	int h = 1 ;
	while ((x+h-1)/h > 20){
		h++ ;
	}
	cout << h << " " << (x+h-1)/h << '\n' ;
	el = (h * ((x+h-1)/h)) - x ;
	for(int i = 1 ; i < h ; i++){
		bool kk = 0 ;
		if(el > 0){
			cout << "*" ;
			kk=1 ;
			el-- ;
		}
		for(int j = 0 ; j < (x+h-1)/h - kk - 1 / h ;j++){
			cout << s[w] ;
			w++ ;
		}
		cout << '\n' ;
	}
	for(int i = w ; i < x ;i++){
		cout << s[i] ;
	}
	return 0 ;
}


#include <bits/stdc++.h>

using namespace std ;

int q , n , m , x , el , w ;
string s ;

int main (){
	cin >> s ;
	x = s.size() ;
	int h = 1 ;
	while ((x+h-1)/h > 20){
		h++ ;
	}
	cout << h << " " << (x+h-1)/h;
	el = (h * ((x+h-1)/h)) - x ;
	cout << '\n'<< el << '\n';
	for(int i = 1 ; i < h ; i++){
		bool kk = 0 ;
		if(el > 0){
			cout << "*" ;
			kk=1 ;
			el-- ;
		}
		for(int j = 0 ; j < (x+h-1)/h - kk - 1 / h ;j++){
			cout << s[w] ;
			w++ ;
		}
		cout << '\n' ;
	}
	for(int i = w ; i < x ;i++){
		cout << s[i] ;
	}
	return 0 ;
}


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

#define int long long
#define pb push_back

int32_t main()
{
    string s;
    cin >> s;
    int l = s.length();
  //  cout<<l<<endl;
    if(l<=20){
        cout<<1<<" "<<l<<"\n";
        cout << s;
        return 0;
    }
    int mn = 99999, row = 0, col = 0;
    for(int i = 1; i <=5; i++){
        int n = l / i;
        if(n*i != l){
            n++;
        }
        int r = n*i;
        if(n<=20){
            row = i;
            mn = r;
            col = n;
            break;
        }
       // cout<<n<<" "<<i<<endl;
    }
//    if(abs(mn-l)>=1){
//        if(row==1 || row==2){
//            row++;
//            int n = l/row;
//            col = n;
//        }
//    }
    mn = row*col;
    for(int i = 0; i < (mn-l); i++){
        s += '*';
        //cout<<"roki"<<endl;
    }
    //cout<<s<<endl;
    int j = 0;
    cout<<row<<" "<<col<<endl;
    int k = 0;
    for(int i = 0; i < row; i++){
       for(int j = 0; j <col; j++){
        cout<<s[k++];
       }
      // cout<<"roki"<<endl;
        cout<<endl;
    }
    return  0;
}
// yyyyyyyyyyyyyyyyyyyyyyy
// yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy //50
// yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy //61


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

#define int long long
#define pb push_back

int32_t main()
{
    string s;
    cin >> s;
    int l = s.length();
    if(l<=20){
        cout<<1<<" "<<l<<"\n";
        cout << s;
        return 0;
    }
    int mn = 99999, row = 0, col = 0;
    for(int i = 5; i >=1; i--){
        int n = l / i;
        if(n*i != l){
            n++;
        }
        int r = n*i;
        if(mn>=r && n<=20){
            row = i;
            mn = r;
            col = n;
        }
    }
    if(abs(mn-l)>=1){
        if(row==1 || row==2){
            row++;
            int n = l/row;
            if(n*row != l){
                n++;
            }
            col = n;
        }
    }
    mn = row*col;
    for(int i = 0; i < (mn-l); i++){
        s += '*';
        //cout<<"roki"<<endl;
    }
    //cout<<s<<endl;
    int j = 0;
    cout<<row<<" "<<col<<endl;
    int k = 0;
    for(int i = 0; i < row; i++){
       for(int j = 0; j <col; j++){
        cout<<s[k++];
       }
      // cout<<"roki"<<endl;
        cout<<endl;
    }
    return  0;
}

// yyyyyyyyyyyyyyyyyyyyyyyyyyyyy


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

#define int long long
#define pb push_back

int32_t main()
{
    string s;
    cin >> s;
    int l = s.length();
    if(l<=20){
        cout<<1<<" "<<l<<"\n";
        cout << s;
        return 0;
    }
    int mn = 99999, row = 0, col = 0;
    for(int i = 1; i <=5; i++){
        int n = l / i;
        if(n*i != l){
            n++;
        }
        int r = n*i;
        if(n<=20){
            row = i;
            mn = r;
            col = n;
            break;
        }
       // cout<<n<<" "<<i<<endl;
    }
    if(abs(mn-l)>=1){
        if(row==1 || row==2){
            row++;
            int n = l/row;
            if(n*row != l){
                n++;
            }
            col = n;
        }
    }
    mn = row*col;
    for(int i = 0; i < (mn-l); i++){
        s += '*';
        //cout<<"roki"<<endl;
    }
    //cout<<s<<endl;
    int j = 0;
    cout<<row<<" "<<col<<endl;
    int k = 0;
    for(int i = 0; i < row; i++){
       for(int j = 0; j <col; j++){
        cout<<s[k++];
       }
      // cout<<"roki"<<endl;
        cout<<endl;
    }
    return  0;
}

// yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy


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

#define int long long
#define pb push_back

int32_t main()
{
    string s;
    cin >> s;
    int l = s.length();
   //cout<<l<<endl;
    if(l<=20){
        cout<<1<<" "<<l<<"\n";
        cout << s;
        return 0;
    }
    int mn = 99999, row = 0, col = 0;
    for(int i = 1; i <=5; i++){
        int n = l / i;
        if(n*i != l){
            n++;
        }
        int r = n*i;
        if(n<=20){
            row = i;
            mn = r;
            col = n;
            break;
        }

    }

    mn = row*col;
    int r = mn - l;
    int f= 0;
    int j = 0;
    cout<<row<<" "<<col<<endl;
    int k = 0;
    for(int i = 0; i < row; i++){
        f = 0;
       for(int j = 0; j <col; j++){
        if(r>=1 && !f){
            r--;
            f = true;
            cout<<'*';
            continue;
        }
        if(k==l) break;
        cout<<s[k++];
       }

        cout<<endl;
    }
    return  0;
}
// yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy
// yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy //50
// yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy //61

// yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy


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

#define int long long
#define pb push_back

int32_t main()
{
    string s;
    cin >> s;
    int l = s.length();
   //cout<<l<<endl;
    if(l<=20){
        cout<<1<<" "<<l<<"\n";
        cout << s;
        return 0;
    }
    int mn = 99999, row = 0, col = 0;
    for(int i = 1; i <=5; i++){
        int n = l / i;
        if(n*i != l){
            n++;
        }
        int r = n*i;
        if(n<=20){
            row = i;
            mn = r;
            col = n;
            break;
        }
       // cout<<n<<" "<<i<<endl;
    }
//    if(abs(mn-l)>=1){
//        if(row==1 || row==2){
//            row++;
//            int n = l/row;
//            col = n;
//        }
//    }
    mn = row*col;
    int r = mn - l;
    int f= 0;
//    for(int i = 0; i < (mn-l); i++){
//        s += '*';
//        //cout<<"roki"<<endl;
//    }
    //cout<<s<<endl;
    int j = 0;
    cout<<row<<" "<<col<<endl;
    int k = 0;
    for(int i = 0; i < row; i++){
        f = 0;
       for(int j = 0; j <col; j++){
        if(r>=1 && (i%2==0) && !f){
            r--;
            f = true;
            cout<<'*';
            continue;
        }
        if(k==l) break;
        cout<<s[k++];
       }

      // cout<<"roki"<<endl;
      if(i<(row-1))
        cout<<endl;
    }
   // cout<<r<<endl;
    for(int i = 0; i < r; i++){
        cout<<'*';
    }
    return  0;
}
// yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy
// yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy //50
// yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy //61

// yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy


#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
char s[105],ans[5][25];
int main(void){
    scanf("%s",s);
    int len=strlen(s);
    if(len<=20){
        printf("1 %d\n",len);
        printf("%s\n",s);
    }else if(len<=40){
        int p=len/2,cnt=0,k=len%2;
        if(k) p++;
        else k=2;
        printf("2 %d\n",p);
        for(int i=0;i<k;i++){
            ans[i][0]='*';
            for(int j=1;j<p;j++) ans[i][j]=s[cnt++];ans[i][p]='\0';
        }
        for(int i=k;i<2;i++){
            for(int j=0;j<p;j++) ans[i][j]=s[cnt++];ans[i][p]='\0';
        }
        for(int i=0;i<2;i++) printf("%s\n",ans[i]);
    }else if(len<=60){
        int p=len/3,cnt=0,k=len%3;
        if(k) p++;
        else k=3;
        printf("3 %d\n",p);
        for(int i=0;i<3-k;i++){
            ans[i][0]='*';
            for(int j=1;j<p;j++) ans[i][j]=s[cnt++];ans[i][p]='\0';
        }
        for(int i=3-k;i<3;i++){
            for(int j=0;j<p;j++) ans[i][j]=s[cnt++];ans[i][p]='\0';
        }
        for(int i=0;i<3;i++) printf("%s\n",ans[i]);
    }else if(len<=80){
        int p=len/4,cnt=0,k=len%4;
        if(k) p++;
        else k=4;
        printf("4 %d\n",p);
        for(int i=0;i<4-k;i++){
            ans[i][0]='*';
            for(int j=1;j<p;j++) ans[i][j]=s[cnt++];ans[i][p]='\0';
        }
        for(int i=4-k;i<4;i++){
            for(int j=0;j<p;j++) ans[i][j]=s[cnt++];ans[i][p]='\0';
        }
        for(int i=0;i<4;i++) printf("%s\n",ans[i]);
    }else if(len<=100){
        int p=len/5,cnt=0,k=len%5;
        if(k) p++;
        else k=5;
        printf("5 %d\n",p);
        for(int i=0;i<5-k;i++){
            ans[i][0]='*';
            for(int j=1;j<p;j++) ans[i][j]=s[cnt++];ans[i][p]='\0';
        }
        for(int i=5-k;i<5;i++){
            for(int j=0;j<p;j++) ans[i][j]=s[cnt++];ans[i][p]='\0';
        }
        for(int i=0;i<5;i++) printf("%s\n",ans[i]);
    }
    return 0;
}
/*
aaaaaaaaaa
*/


#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
char s[105],ans[5][25];
int main(void){
    scanf("%s",s);
    int len=strlen(s);
    if(len<=20){
        printf("1 %d\n",len);
        printf("%s\n",s);
    }else if(len<=40){
        int p=len/2,cnt=0,k=len%2;
        if(k) p++;
        else k=2;
        printf("2 %d\n",p);
        for(int i=0;i<2-k;i++){
            ans[i][0]='*';
            for(int j=1;j<p;j++) ans[i][j]=s[cnt++];ans[i][p]='\0';
        }
        for(int i=2-k;i<2;i++){
            for(int j=0;j<p;j++) ans[i][j]=s[cnt++];ans[i][p]='\0';
        }
        for(int i=0;i<2;i++) printf("%s\n",ans[i]);
    }else if(len<=60){
        int p=len/3,cnt=0,k=len%3;
        if(k) p++;
        else k=3;
        printf("3 %d\n",p);
        for(int i=0;i<3-k;i++){
            ans[i][0]='*';
            for(int j=1;j<p;j++) ans[i][j]=s[cnt++];ans[i][p]='\0';
        }
        for(int i=3-k;i<3;i++){
            for(int j=0;j<p;j++) ans[i][j]=s[cnt++];ans[i][p]='\0';
        }
        for(int i=0;i<3;i++) printf("%s\n",ans[i]);
    }else if(len<=80){
        int p=len/4,cnt=0,k=len%4;
        if(k) p++;
        else k=4;
        printf("4 %d\n",p);
        for(int i=0;i<4-k;i++){
            ans[i][0]='*';
            for(int j=1;j<p;j++) ans[i][j]=s[cnt++];ans[i][p]='\0';
        }
        for(int i=4-k;i<4;i++){
            for(int j=0;j<p;j++) ans[i][j]=s[cnt++];ans[i][p]='\0';
        }
        for(int i=0;i<4;i++) printf("%s\n",ans[i]);
    }else if(len<=100){
        int p=len/5,cnt=0,k=len%5;
        if(k) p++;
        else k=5;
        printf("5 %d\n",p);
        for(int i=0;i<5-k;i++){
            ans[i][0]='*';
            for(int j=1;j<p;j++) ans[i][j]=s[cnt++];ans[i][p]='\0';
        }
        for(int i=5-k;i<5;i++){
            for(int j=0;j<p;j++) ans[i][j]=s[cnt++];ans[i][p]='\0';
        }
        for(int i=0;i<5;i++) printf("%s\n",ans[i]);
    }
    return 0;
}
/*
aaaaaaaaaa
*/


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

//#define getchar getchar_unlocked
//#define putchar putchar_unlocked
#define eb emplace_back
#define lb lower_bound
#define ub upper_bound
#define mp make_pair
#define ff first
#define ss second

typedef long long int ll;
typedef long double ld;
typedef short int sh;

inline void readI(int *i)
{
	register int t=0;
	register char z=getchar();
	int znak=1;
	if (z=='-')
	{
		znak=-1;
	}
	while ((z<'0') || ('9'<z))
	{
		z=getchar();
		if (z=='-')
		{
			znak=-1;
		}
	}
	while (('0'<=z) && (z<='9'))
	{
		t=(t<<3)+(t<<1)+z-'0';
		z=getchar();
	}
	*i=(t*znak);
}
inline void readUI(int *i)
{
	register int t=0;
	register char z=getchar();
	while ((z<'0') || ('9'<z))
	{
		z=getchar();
	}
	while (('0'<=z) && (z<='9'))
	{
		t=(t<<3)+(t<<1)+z-'0';
		z=getchar();
	}
	*i=t;
}
inline void readL(ll *l)
{
	register ll t=0;
	register char z=getchar();
	int znak=1;
	if (z=='-')
	{
		znak*=-1;
	}
	while ((z<'0') || ('9'<z))
	{
		z=getchar();
		if (z=='-')
		{
			znak=-1;
		}
	}
	while (('0'<=z) && (z<='9'))
	{
		t=(t<<3)+(t<<1)+z-'0';
		z=getchar();
	}
	*l=(t*znak);
}
inline void readUL(ll *l)
{
	register ll t=0;
	register char z=getchar();
	while ((z<'0') || ('9'<z))
	{
		z=getchar();
	}
	while (('0'<=z) && (z<='9'))
	{
		t=(t<<3)+(t<<1)+z-'0';
		z=getchar();
	}
	*l=t;
}
inline void writeI(int i)
{
	if (i==0)
	{
		putchar(48);
	}
	else
	{
		if (i<0)
		{
		   i*=-1;
		   putchar(45);
		}
		int _tab[12];
		int wsk=0;
		while (i>0)
		{
			++wsk;
			_tab[wsk]=(i%10)+48;
			i/=10;
		}
		for (int j=wsk; j>=1; --j)
		{
			putchar(_tab[j]);
		}
	}
}
inline void writeL(ll l)
{
	if (l==0)
	{
		putchar(48);
	}
	else
	{
		if (l<0)
		{
		   l*=-1;
		   putchar(45);
		}
		int _tab[21];
		int wsk=0;
		while (l>0)
		{
			++wsk;
			_tab[wsk]=(l%10)+48;
			l/=10;
		}
		for (int j=wsk; j>=1; --j)
		{
			putchar(_tab[j]);
		}
	}
}
inline void writeS(string s)
{
	int l=s.length();
	for (int i=0; i<l; ++i)
	{
		putchar(s[i]);
	}
}
inline void writeC(char c)
{
	putchar(c);
}
inline void space()
{
	putchar(32);
}
inline void endl()
{
	putchar(10);
}

#define debug if(1)
#define debug2 if(1)
#define debug3 if(1)
#define debug4 if(1)

char s[105];
int n;

int main()
{
	scanf ("%s", s);
	n=strlen(s);
	if (n<=20)
	{
		printf ("1 %d\n", n);
		for (int i=0; i<n; ++i)
		{
			printf ("%c", s[i]);
		}
		return 0;
	}
	else if (n<=40)
	{
		int pom=(n>>1);
		printf ("2 %d\n", (n+1)>>1);
		if ((pom<<1)==n)
		{
			for (int i=0; i<(n>>1); ++i)
			{
				printf ("%c", s[i]);
			}
			puts ("");
			for (int i=(n>>1); i<n; ++i)
			{
				printf ("%c", s[i]);
			}
		}
		else
		{
			for (int i=0; i<=(n>>1); ++i)
			{
				printf ("%c", s[i]);
			}
			printf ("\n*");
			for (int i=(n>>1)+1; i<n; ++i)
			{
				printf ("%c", s[i]);
			}
		}
		return 0;
	}
	int ile=n/20;
	if (ile*20!=n)
	{
		++ile;
	}
	int dl=n/ile;
	if (dl*ile!=n)
	{
		++dl;
	}
	printf ("%d %d\n", ile, dl);
	int gw=dl*ile-n;
	int wsk=-1;
	for (int i=1; i<=ile; ++i)
	{
		for (int j=1; j<=dl; ++j)
		{
			if (j==1)
			{
				if (gw>0)
				{
					printf ("*");
					--gw;
				}
				else
				{
					++wsk;
					printf ("%c", s[wsk]);
				}
			}
			else
			{
				++wsk;
				printf ("%c", s[wsk]);
			}
		}
		puts ("");
	}
	return 0;
}
/*
*/


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

//#define getchar getchar_unlocked
//#define putchar putchar_unlocked
#define eb emplace_back
#define lb lower_bound
#define ub upper_bound
#define mp make_pair
#define ff first
#define ss second

typedef long long int ll;
typedef long double ld;
typedef short int sh;

inline void readI(int *i)
{
	register int t=0;
	register char z=getchar();
	int znak=1;
	if (z=='-')
	{
		znak=-1;
	}
	while ((z<'0') || ('9'<z))
	{
		z=getchar();
		if (z=='-')
		{
			znak=-1;
		}
	}
	while (('0'<=z) && (z<='9'))
	{
		t=(t<<3)+(t<<1)+z-'0';
		z=getchar();
	}
	*i=(t*znak);
}
inline void readUI(int *i)
{
	register int t=0;
	register char z=getchar();
	while ((z<'0') || ('9'<z))
	{
		z=getchar();
	}
	while (('0'<=z) && (z<='9'))
	{
		t=(t<<3)+(t<<1)+z-'0';
		z=getchar();
	}
	*i=t;
}
inline void readL(ll *l)
{
	register ll t=0;
	register char z=getchar();
	int znak=1;
	if (z=='-')
	{
		znak*=-1;
	}
	while ((z<'0') || ('9'<z))
	{
		z=getchar();
		if (z=='-')
		{
			znak=-1;
		}
	}
	while (('0'<=z) && (z<='9'))
	{
		t=(t<<3)+(t<<1)+z-'0';
		z=getchar();
	}
	*l=(t*znak);
}
inline void readUL(ll *l)
{
	register ll t=0;
	register char z=getchar();
	while ((z<'0') || ('9'<z))
	{
		z=getchar();
	}
	while (('0'<=z) && (z<='9'))
	{
		t=(t<<3)+(t<<1)+z-'0';
		z=getchar();
	}
	*l=t;
}
inline void writeI(int i)
{
	if (i==0)
	{
		putchar(48);
	}
	else
	{
		if (i<0)
		{
		   i*=-1;
		   putchar(45);
		}
		int _tab[12];
		int wsk=0;
		while (i>0)
		{
			++wsk;
			_tab[wsk]=(i%10)+48;
			i/=10;
		}
		for (int j=wsk; j>=1; --j)
		{
			putchar(_tab[j]);
		}
	}
}
inline void writeL(ll l)
{
	if (l==0)
	{
		putchar(48);
	}
	else
	{
		if (l<0)
		{
		   l*=-1;
		   putchar(45);
		}
		int _tab[21];
		int wsk=0;
		while (l>0)
		{
			++wsk;
			_tab[wsk]=(l%10)+48;
			l/=10;
		}
		for (int j=wsk; j>=1; --j)
		{
			putchar(_tab[j]);
		}
	}
}
inline void writeS(string s)
{
	int l=s.length();
	for (int i=0; i<l; ++i)
	{
		putchar(s[i]);
	}
}
inline void writeC(char c)
{
	putchar(c);
}
inline void space()
{
	putchar(32);
}
inline void endl()
{
	putchar(10);
}

#define debug if(1)
#define debug2 if(1)
#define debug3 if(1)
#define debug4 if(1)

char s[105];
int n;

int main()
{
	scanf ("%s", s);
	n=strlen(s);
	if (n<=20)
	{
		printf ("1 %d\n", n);
		for (int i=0; i<n; ++i)
		{
			printf ("%c", s[i]);
		}
		return 0;
	}
	else if (n<=40)
	{
		int pom=(n>>1);
		printf ("2 %d\n", (n+1)>>1);
		if ((pom<<1)==n)
		{
			for (int i=0; i<(n>>1); ++i)
			{
				printf ("%c", s[i]);
			}
			puts ("");
			for (int i=(n>>1); i<n; ++i)
			{
				printf ("%c", s[i]);
			}
		}
		else
		{
			for (int i=0; i<(n>>1); ++i)
			{
				printf ("%c", s[i]);
			}
			printf ("\n*");
			for (int i=(n>>1)+1; i<=n; ++i)
			{
				printf ("%c", s[i]);
			}
		}
		return 0;
	}
	int ile=n/20;
	if (ile*20!=n)
	{
		++ile;
	}
	int dl=n/ile;
	if (dl*ile!=n)
	{
		++dl;
	}
	printf ("%d %d\n", ile, dl);
	int gw=dl*ile-n;
	int wsk=-1;
	for (int i=1; i<=ile; ++i)
	{
		for (int j=1; j<=dl; ++j)
		{
			if (j==1)
			{
				if (gw>0)
				{
					printf ("*");
					--gw;
				}
				else
				{
					++wsk;
					printf ("%c", s[wsk]);
				}
			}
			else
			{
				++wsk;
				printf ("%c", s[wsk]);
			}
		}
		puts ("");
	}
	return 0;
}
/*
*/


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

//#define getchar getchar_unlocked
//#define putchar putchar_unlocked
#define eb emplace_back
#define lb lower_bound
#define ub upper_bound
#define mp make_pair
#define ff first
#define ss second

typedef long long int ll;
typedef long double ld;
typedef short int sh;

inline void readI(int *i)
{
	register int t=0;
	register char z=getchar();
	int znak=1;
	if (z=='-')
	{
		znak=-1;
	}
	while ((z<'0') || ('9'<z))
	{
		z=getchar();
		if (z=='-')
		{
			znak=-1;
		}
	}
	while (('0'<=z) && (z<='9'))
	{
		t=(t<<3)+(t<<1)+z-'0';
		z=getchar();
	}
	*i=(t*znak);
}
inline void readUI(int *i)
{
	register int t=0;
	register char z=getchar();
	while ((z<'0') || ('9'<z))
	{
		z=getchar();
	}
	while (('0'<=z) && (z<='9'))
	{
		t=(t<<3)+(t<<1)+z-'0';
		z=getchar();
	}
	*i=t;
}
inline void readL(ll *l)
{
	register ll t=0;
	register char z=getchar();
	int znak=1;
	if (z=='-')
	{
		znak*=-1;
	}
	while ((z<'0') || ('9'<z))
	{
		z=getchar();
		if (z=='-')
		{
			znak=-1;
		}
	}
	while (('0'<=z) && (z<='9'))
	{
		t=(t<<3)+(t<<1)+z-'0';
		z=getchar();
	}
	*l=(t*znak);
}
inline void readUL(ll *l)
{
	register ll t=0;
	register char z=getchar();
	while ((z<'0') || ('9'<z))
	{
		z=getchar();
	}
	while (('0'<=z) && (z<='9'))
	{
		t=(t<<3)+(t<<1)+z-'0';
		z=getchar();
	}
	*l=t;
}
inline void writeI(int i)
{
	if (i==0)
	{
		putchar(48);
	}
	else
	{
		if (i<0)
		{
		   i*=-1;
		   putchar(45);
		}
		int _tab[12];
		int wsk=0;
		while (i>0)
		{
			++wsk;
			_tab[wsk]=(i%10)+48;
			i/=10;
		}
		for (int j=wsk; j>=1; --j)
		{
			putchar(_tab[j]);
		}
	}
}
inline void writeL(ll l)
{
	if (l==0)
	{
		putchar(48);
	}
	else
	{
		if (l<0)
		{
		   l*=-1;
		   putchar(45);
		}
		int _tab[21];
		int wsk=0;
		while (l>0)
		{
			++wsk;
			_tab[wsk]=(l%10)+48;
			l/=10;
		}
		for (int j=wsk; j>=1; --j)
		{
			putchar(_tab[j]);
		}
	}
}
inline void writeS(string s)
{
	int l=s.length();
	for (int i=0; i<l; ++i)
	{
		putchar(s[i]);
	}
}
inline void writeC(char c)
{
	putchar(c);
}
inline void space()
{
	putchar(32);
}
inline void endl()
{
	putchar(10);
}

#define debug if(1)
#define debug2 if(1)
#define debug3 if(1)
#define debug4 if(1)

char s[105];
int n;

int main()
{
	scanf ("%s", s);
	n=strlen(s);
	if (n<=20)
	{
		printf ("1 %d\n", n);
		for (int i=0; i<n; ++i)
		{
			printf ("%c", s[i]);
		}
		return 0;
	}
	else if (n<=40)
	{
		int pom=(n>>1);
		printf ("2 %d\n", (n+1)>>1);
		if ((pom<<1)==n)
		{
			for (int i=0; i<(n>>1); ++i)
			{
				printf ("%c", s[i]);
			}
			puts ("");
			for (int i=(n>>1); i<n; ++i)
			{
				printf ("%c", s[i]);
			}
		}
		else
		{
			for (int i=0; i<(n>>1); ++i)
			{
				printf ("%c", s[i]);
			}
			printf ("\n*");
			for (int i=(n>>1)+1; i<n; ++i)
			{
				printf ("%c", s[i]);
			}
		}
		return 0;
	}
	int ile=n/20;
	if (ile*20!=n)
	{
		++ile;
	}
	int dl=n/ile;
	if (dl*ile!=n)
	{
		++dl;
	}
	printf ("%d %d\n", ile, dl);
	int gw=dl*ile-n;
	int wsk=-1;
	for (int i=1; i<=ile; ++i)
	{
		for (int j=1; j<=dl; ++j)
		{
			if (j==1)
			{
				if (gw>0)
				{
					printf ("*");
					--gw;
				}
				else
				{
					++wsk;
					printf ("%c", s[wsk]);
				}
			}
			else
			{
				++wsk;
				printf ("%c", s[wsk]);
			}
		}
		puts ("");
	}
	return 0;
}
/*
*/


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

//#define getchar getchar_unlocked
//#define putchar putchar_unlocked
#define eb emplace_back
#define lb lower_bound
#define ub upper_bound
#define mp make_pair
#define ff first
#define ss second

typedef long long int ll;
typedef long double ld;
typedef short int sh;

inline void readI(int *i)
{
	register int t=0;
	register char z=getchar();
	int znak=1;
	if (z=='-')
	{
		znak=-1;
	}
	while ((z<'0') || ('9'<z))
	{
		z=getchar();
		if (z=='-')
		{
			znak=-1;
		}
	}
	while (('0'<=z) && (z<='9'))
	{
		t=(t<<3)+(t<<1)+z-'0';
		z=getchar();
	}
	*i=(t*znak);
}
inline void readUI(int *i)
{
	register int t=0;
	register char z=getchar();
	while ((z<'0') || ('9'<z))
	{
		z=getchar();
	}
	while (('0'<=z) && (z<='9'))
	{
		t=(t<<3)+(t<<1)+z-'0';
		z=getchar();
	}
	*i=t;
}
inline void readL(ll *l)
{
	register ll t=0;
	register char z=getchar();
	int znak=1;
	if (z=='-')
	{
		znak*=-1;
	}
	while ((z<'0') || ('9'<z))
	{
		z=getchar();
		if (z=='-')
		{
			znak=-1;
		}
	}
	while (('0'<=z) && (z<='9'))
	{
		t=(t<<3)+(t<<1)+z-'0';
		z=getchar();
	}
	*l=(t*znak);
}
inline void readUL(ll *l)
{
	register ll t=0;
	register char z=getchar();
	while ((z<'0') || ('9'<z))
	{
		z=getchar();
	}
	while (('0'<=z) && (z<='9'))
	{
		t=(t<<3)+(t<<1)+z-'0';
		z=getchar();
	}
	*l=t;
}
inline void writeI(int i)
{
	if (i==0)
	{
		putchar(48);
	}
	else
	{
		if (i<0)
		{
		   i*=-1;
		   putchar(45);
		}
		int _tab[12];
		int wsk=0;
		while (i>0)
		{
			++wsk;
			_tab[wsk]=(i%10)+48;
			i/=10;
		}
		for (int j=wsk; j>=1; --j)
		{
			putchar(_tab[j]);
		}
	}
}
inline void writeL(ll l)
{
	if (l==0)
	{
		putchar(48);
	}
	else
	{
		if (l<0)
		{
		   l*=-1;
		   putchar(45);
		}
		int _tab[21];
		int wsk=0;
		while (l>0)
		{
			++wsk;
			_tab[wsk]=(l%10)+48;
			l/=10;
		}
		for (int j=wsk; j>=1; --j)
		{
			putchar(_tab[j]);
		}
	}
}
inline void writeS(string s)
{
	int l=s.length();
	for (int i=0; i<l; ++i)
	{
		putchar(s[i]);
	}
}
inline void writeC(char c)
{
	putchar(c);
}
inline void space()
{
	putchar(32);
}
inline void endl()
{
	putchar(10);
}

#define debug if(1)
#define debug2 if(1)
#define debug3 if(1)
#define debug4 if(1)

char s[105];
int n;

int main()
{
	scanf ("%s", s);
	n=strlen(s);
	if (n<=20)
	{
		printf ("1 %d\n", n);
		for (int i=0; i<n; ++i)
		{
			printf ("%c", s[i]);
		}
		return 0;
	}
	else if (n<=40)
	{
		int pom=(n>>1);
		printf ("2 %d\n", (n+1)>>1);
		if ((pom<<1)==n)
		{
			for (int i=0; i<(n>>1); ++i)
			{
				printf ("%c", s[i]);
			}
			puts ("");
			for (int i=(n>>1); i<n; ++i)
			{
				printf ("%c", s[i]);
			}
		}
		else
		{
			for (int i=0; i<(n>>1); ++i)
			{
				printf ("%c", s[i]);
			}
			printf ("\n*");
			for (int i=(n>>1); i<n; ++i)
			{
				printf ("%c", s[i]);
			}
		}
		return 0;
	}
	int ile=n/20;
	if (ile*20!=n)
	{
		++ile;
	}
	int dl=n/ile;
	if (dl*ile!=n)
	{
		++dl;
	}
	printf ("%d %d\n", ile, dl);
	int gw=dl*ile-n;
	int wsk=-1;
	for (int i=1; i<=ile; ++i)
	{
		for (int j=1; j<=dl; ++j)
		{
			if (j==1)
			{
				if (gw>0)
				{
					printf ("*");
					--gw;
				}
				else
				{
					++wsk;
					printf ("%c", s[wsk]);
				}
			}
			else
			{
				++wsk;
				printf ("%c", s[wsk]);
			}
		}
		puts ("");
	}
	return 0;
}
/*
*/


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

//#define getchar getchar_unlocked
//#define putchar putchar_unlocked
#define eb emplace_back
#define lb lower_bound
#define ub upper_bound
#define mp make_pair
#define ff first
#define ss second

typedef long long int ll;
typedef long double ld;
typedef short int sh;

inline void readI(int *i)
{
	register int t=0;
	register char z=getchar();
	int znak=1;
	if (z=='-')
	{
		znak=-1;
	}
	while ((z<'0') || ('9'<z))
	{
		z=getchar();
		if (z=='-')
		{
			znak=-1;
		}
	}
	while (('0'<=z) && (z<='9'))
	{
		t=(t<<3)+(t<<1)+z-'0';
		z=getchar();
	}
	*i=(t*znak);
}
inline void readUI(int *i)
{
	register int t=0;
	register char z=getchar();
	while ((z<'0') || ('9'<z))
	{
		z=getchar();
	}
	while (('0'<=z) && (z<='9'))
	{
		t=(t<<3)+(t<<1)+z-'0';
		z=getchar();
	}
	*i=t;
}
inline void readL(ll *l)
{
	register ll t=0;
	register char z=getchar();
	int znak=1;
	if (z=='-')
	{
		znak*=-1;
	}
	while ((z<'0') || ('9'<z))
	{
		z=getchar();
		if (z=='-')
		{
			znak=-1;
		}
	}
	while (('0'<=z) && (z<='9'))
	{
		t=(t<<3)+(t<<1)+z-'0';
		z=getchar();
	}
	*l=(t*znak);
}
inline void readUL(ll *l)
{
	register ll t=0;
	register char z=getchar();
	while ((z<'0') || ('9'<z))
	{
		z=getchar();
	}
	while (('0'<=z) && (z<='9'))
	{
		t=(t<<3)+(t<<1)+z-'0';
		z=getchar();
	}
	*l=t;
}
inline void writeI(int i)
{
	if (i==0)
	{
		putchar(48);
	}
	else
	{
		if (i<0)
		{
		   i*=-1;
		   putchar(45);
		}
		int _tab[12];
		int wsk=0;
		while (i>0)
		{
			++wsk;
			_tab[wsk]=(i%10)+48;
			i/=10;
		}
		for (int j=wsk; j>=1; --j)
		{
			putchar(_tab[j]);
		}
	}
}
inline void writeL(ll l)
{
	if (l==0)
	{
		putchar(48);
	}
	else
	{
		if (l<0)
		{
		   l*=-1;
		   putchar(45);
		}
		int _tab[21];
		int wsk=0;
		while (l>0)
		{
			++wsk;
			_tab[wsk]=(l%10)+48;
			l/=10;
		}
		for (int j=wsk; j>=1; --j)
		{
			putchar(_tab[j]);
		}
	}
}
inline void writeS(string s)
{
	int l=s.length();
	for (int i=0; i<l; ++i)
	{
		putchar(s[i]);
	}
}
inline void writeC(char c)
{
	putchar(c);
}
inline void space()
{
	putchar(32);
}
inline void endl()
{
	putchar(10);
}

#define debug if(1)
#define debug2 if(1)
#define debug3 if(1)
#define debug4 if(1)

char s[105];
int n;

int main()
{
	scanf ("%s", s);
	n=strlen(s);
	if (n<=20)
	{
		printf ("1 %d\n", n);
		for (int i=0; i<n; ++i)
		{
			printf ("%c", s[i]);
		}
		return 0;
	}
	else if (n<=40)
	{
		int pom=(n>>1);
		printf ("2 %d\n", (n+1)>>1);
		if ((pom<<1)==n)
		{
			for (int i=0; i<(n>>1); ++i)
			{
				printf ("%c", s[i]);
			}
			puts ("");
			for (int i=(n>>1); i<n; ++i)
			{
				printf ("%c", s[i]);
			}
		}
		else
		{
			printf ("*");
			for (int i=1; i<(n>>1); ++i)
			{
				printf ("%c", s[i]);
			}
			puts ("");
			for (int i=(n>>1)+1; i<=n; ++i)
			{
				printf ("%c", s[i]);
			}
		}
		return 0;
	}
	int ile=n/20;
	if (ile*20!=n)
	{
		++ile;
	}
	int dl=n/ile;
	if (dl*ile!=n)
	{
		++dl;
	}
	printf ("%d %d\n", ile, dl);
	int gw=dl*ile-n;
	int wsk=-1;
	for (int i=1; i<=ile; ++i)
	{
		for (int j=1; j<=dl; ++j)
		{
			if (j==1)
			{
				if (gw>0)
				{
					printf ("*");
					--gw;
				}
				else
				{
					++wsk;
					printf ("%c", s[wsk]);
				}
			}
			else
			{
				++wsk;
				printf ("%c", s[wsk]);
			}
		}
		puts ("");
	}
	return 0;
}
/*
*/


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

//#define getchar getchar_unlocked
//#define putchar putchar_unlocked
#define eb emplace_back
#define lb lower_bound
#define ub upper_bound
#define mp make_pair
#define ff first
#define ss second

typedef long long int ll;
typedef long double ld;
typedef short int sh;

inline void readI(int *i)
{
	register int t=0;
	register char z=getchar();
	int znak=1;
	if (z=='-')
	{
		znak=-1;
	}
	while ((z<'0') || ('9'<z))
	{
		z=getchar();
		if (z=='-')
		{
			znak=-1;
		}
	}
	while (('0'<=z) && (z<='9'))
	{
		t=(t<<3)+(t<<1)+z-'0';
		z=getchar();
	}
	*i=(t*znak);
}
inline void readUI(int *i)
{
	register int t=0;
	register char z=getchar();
	while ((z<'0') || ('9'<z))
	{
		z=getchar();
	}
	while (('0'<=z) && (z<='9'))
	{
		t=(t<<3)+(t<<1)+z-'0';
		z=getchar();
	}
	*i=t;
}
inline void readL(ll *l)
{
	register ll t=0;
	register char z=getchar();
	int znak=1;
	if (z=='-')
	{
		znak*=-1;
	}
	while ((z<'0') || ('9'<z))
	{
		z=getchar();
		if (z=='-')
		{
			znak=-1;
		}
	}
	while (('0'<=z) && (z<='9'))
	{
		t=(t<<3)+(t<<1)+z-'0';
		z=getchar();
	}
	*l=(t*znak);
}
inline void readUL(ll *l)
{
	register ll t=0;
	register char z=getchar();
	while ((z<'0') || ('9'<z))
	{
		z=getchar();
	}
	while (('0'<=z) && (z<='9'))
	{
		t=(t<<3)+(t<<1)+z-'0';
		z=getchar();
	}
	*l=t;
}
inline void writeI(int i)
{
	if (i==0)
	{
		putchar(48);
	}
	else
	{
		if (i<0)
		{
		   i*=-1;
		   putchar(45);
		}
		int _tab[12];
		int wsk=0;
		while (i>0)
		{
			++wsk;
			_tab[wsk]=(i%10)+48;
			i/=10;
		}
		for (int j=wsk; j>=1; --j)
		{
			putchar(_tab[j]);
		}
	}
}
inline void writeL(ll l)
{
	if (l==0)
	{
		putchar(48);
	}
	else
	{
		if (l<0)
		{
		   l*=-1;
		   putchar(45);
		}
		int _tab[21];
		int wsk=0;
		while (l>0)
		{
			++wsk;
			_tab[wsk]=(l%10)+48;
			l/=10;
		}
		for (int j=wsk; j>=1; --j)
		{
			putchar(_tab[j]);
		}
	}
}
inline void writeS(string s)
{
	int l=s.length();
	for (int i=0; i<l; ++i)
	{
		putchar(s[i]);
	}
}
inline void writeC(char c)
{
	putchar(c);
}
inline void space()
{
	putchar(32);
}
inline void endl()
{
	putchar(10);
}

#define debug if(1)
#define debug2 if(1)
#define debug3 if(1)
#define debug4 if(1)

char s[105];
int n;

int main()
{
	scanf ("%s", s);
	n=strlen(s);
	if (n<=20)
	{
		printf ("1 %d\n", n);
		for (int i=0; i<n; ++i)
		{
			printf ("%c", s[i]);
		}
		return 0;
	}
	else if (n<=40)
	{
		int pom=(n>>1);
		printf ("2 %d\n", (n+1)>>1);
		if ((pom<<1)==n)
		{
			for (int i=0; i<(n>>1); ++i)
			{
				printf ("%c", s[i]);
			}
			puts ("");
			for (int i=(n>>1); i<n; ++i)
			{
				printf ("%c", s[i]);
			}
		}
		else
		{
			for (int i=0; i<=(n>>1); ++i)
			{
				printf ("%c", s[i]);
			}
			printf ("\n*");
			for (int i=(n>>1); i<n; ++i)
			{
				printf ("%c", s[i]);
			}
		}
		return 0;
	}
	int ile=n/20;
	if (ile*20!=n)
	{
		++ile;
	}
	int dl=n/ile;
	if (dl*ile!=n)
	{
		++dl;
	}
	printf ("%d %d\n", ile, dl);
	int gw=dl*ile-n;
	int wsk=-1;
	for (int i=1; i<=ile; ++i)
	{
		for (int j=1; j<=dl; ++j)
		{
			if (j==1)
			{
				if (gw>0)
				{
					printf ("*");
					--gw;
				}
				else
				{
					++wsk;
					printf ("%c", s[wsk]);
				}
			}
			else
			{
				++wsk;
				printf ("%c", s[wsk]);
			}
		}
		puts ("");
	}
	return 0;
}
/*
*/


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

//#define getchar getchar_unlocked
//#define putchar putchar_unlocked
#define eb emplace_back
#define lb lower_bound
#define ub upper_bound
#define mp make_pair
#define ff first
#define ss second

typedef long long int ll;
typedef long double ld;
typedef short int sh;

inline void readI(int *i)
{
	register int t=0;
	register char z=getchar();
	int znak=1;
	if (z=='-')
	{
		znak=-1;
	}
	while ((z<'0') || ('9'<z))
	{
		z=getchar();
		if (z=='-')
		{
			znak=-1;
		}
	}
	while (('0'<=z) && (z<='9'))
	{
		t=(t<<3)+(t<<1)+z-'0';
		z=getchar();
	}
	*i=(t*znak);
}
inline void readUI(int *i)
{
	register int t=0;
	register char z=getchar();
	while ((z<'0') || ('9'<z))
	{
		z=getchar();
	}
	while (('0'<=z) && (z<='9'))
	{
		t=(t<<3)+(t<<1)+z-'0';
		z=getchar();
	}
	*i=t;
}
inline void readL(ll *l)
{
	register ll t=0;
	register char z=getchar();
	int znak=1;
	if (z=='-')
	{
		znak*=-1;
	}
	while ((z<'0') || ('9'<z))
	{
		z=getchar();
		if (z=='-')
		{
			znak=-1;
		}
	}
	while (('0'<=z) && (z<='9'))
	{
		t=(t<<3)+(t<<1)+z-'0';
		z=getchar();
	}
	*l=(t*znak);
}
inline void readUL(ll *l)
{
	register ll t=0;
	register char z=getchar();
	while ((z<'0') || ('9'<z))
	{
		z=getchar();
	}
	while (('0'<=z) && (z<='9'))
	{
		t=(t<<3)+(t<<1)+z-'0';
		z=getchar();
	}
	*l=t;
}
inline void writeI(int i)
{
	if (i==0)
	{
		putchar(48);
	}
	else
	{
		if (i<0)
		{
		   i*=-1;
		   putchar(45);
		}
		int _tab[12];
		int wsk=0;
		while (i>0)
		{
			++wsk;
			_tab[wsk]=(i%10)+48;
			i/=10;
		}
		for (int j=wsk; j>=1; --j)
		{
			putchar(_tab[j]);
		}
	}
}
inline void writeL(ll l)
{
	if (l==0)
	{
		putchar(48);
	}
	else
	{
		if (l<0)
		{
		   l*=-1;
		   putchar(45);
		}
		int _tab[21];
		int wsk=0;
		while (l>0)
		{
			++wsk;
			_tab[wsk]=(l%10)+48;
			l/=10;
		}
		for (int j=wsk; j>=1; --j)
		{
			putchar(_tab[j]);
		}
	}
}
inline void writeS(string s)
{
	int l=s.length();
	for (int i=0; i<l; ++i)
	{
		putchar(s[i]);
	}
}
inline void writeC(char c)
{
	putchar(c);
}
inline void space()
{
	putchar(32);
}
inline void endl()
{
	putchar(10);
}

#define debug if(1)
#define debug2 if(1)
#define debug3 if(1)
#define debug4 if(1)

char s[105];
int n;

int main()
{
	scanf ("%s", s);
	n=strlen(s);
	if (n<=20)
	{
		printf ("1 %d\n", n);
		for (int i=0; i<n; ++i)
		{
			printf ("%c", s[i]);
		}
		return 0;
	}
	else if (n<=40)
	{
		int pom=(n>>1);
		printf ("2 %d\n", (n+1)>>1);
		if ((pom<<1)==n)
		{
			for (int i=0; i<(n>>1); ++i)
			{
				printf ("%c", s[i]);
			}
			puts ("");
			for (int i=(n>>1); i<n; ++i)
			{
				printf ("%c", s[i]);
			}
		}
		return 0;
	}
	int ile=n/20;
	if (ile*20!=n)
	{
		++ile;
	}
	int dl=n/ile;
	if (dl*ile!=n)
	{
		++dl;
	}
	printf ("%d %d\n", ile, dl);
	int gw=dl*ile-n;
	int wsk=-1;
	for (int i=1; i<=ile; ++i)
	{
		for (int j=1; j<=dl; ++j)
		{
			if (j==1)
			{
				if (gw>0)
				{
					printf ("*");
					--gw;
				}
				else
				{
					++wsk;
					printf ("%c", s[wsk]);
				}
			}
			else
			{
				++wsk;
				printf ("%c", s[wsk]);
			}
		}
		puts ("");
	}
	return 0;
}
/*
*/


#include<bits/stdc++.h>
using namespace std;
string a;
int i,j,n,l,row,m,ind;

int main()
{
    cin >> a;
    row=1;

    n=a.size();
    ind=0;
    if(n<=20)
    {
        cout <<row <<" " <<n <<endl;
        cout<<a <<endl;
    }
    else{
        row++;
        m=n/row;
        while(m > 20 )
        {
          row++ ;
          m=n/row;

        }
        if(n%row ==0)
        {
            cout << row <<" " << m <<endl;
            for(i=0;i<row;i++)
            {
                for(j=0;j<m;j++)
                {
                    cout<<a[ind];
                    ind++;
                }
                cout<<endl;
            }
            cout <<endl;

        }
        else {

            l = n%row;
            l = row-l;
            m++;
             ind=0;
            cout <<row <<" " <<m <<endl;
            for(i=0;i<row;i++)
            {
                for(j=0;j<m;j++)
                {
                    if(l>0)
                    {

                        if(j==m-1)
                        {
                            cout<<"*";
                            l--;
                        }
                        else {
                            cout <<a[ind] ;
                            ind++;
                        }
                    }
                    else{
                        cout <<a[ind] ;
                        ind++;
                    }

                }
                cout<<endl;

            }
        }

    }

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
string a;
int i,j,n,l,row,m;

int main()
{
    cin >> a;
    row=1;

    n=a.size();

    if(n<=20)
    {
        cout <<row <<" " <<n <<endl;
        cout<<a <<endl;
    }
    else{
        row++;
        m=n/row;
        while(m > 20 )
        {
          row++ ;
          m=n/row;
          if(row==5) break;
        }
        if(n%row ==0)
        {
            cout << row <<" " << m <<endl;
            for(i=0;i<row;i++)
            {
                for(j=0;j<m;j++)
                {
                    cout<<a[i*j+j];
                }
                cout<<endl;
            }
            cout <<endl;

        }
        else {

            l = n%row;
            l = row-l;
            m++;
            int ind=0;
            cout <<row <<" " <<m <<endl;
            for(i=0;i<row;i++)
            {
                for(j=0;j<m;j++)
                {
                    if(l>0)
                    {

                        if(j==m-1)
                        {
                            cout<<"*";
                            l--;
                        }
                        else {
                            cout <<a[ind] ;
                            ind++;
                        }
                    }
                    else{
                        cout <<a[ind] ;
                        ind++;
                    }

                }
                cout<<endl;

            }
        }

    }

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
string a;
int i,j,n,l,row,m,ind;

int main()
{
    cin >> a;
    row=1;

    n=a.size();
    ind=0;
    if(n<=20)
    {
        cout <<row <<" " <<n <<endl;
        cout<<a <<endl;
    }
    else{
        row++;
        m=n/row;
        while(m >= 20 )
        {
          row++ ;
          m=n/row;

        }
        if(n%row ==0)
        {
            cout << row <<" " << m <<endl;
            for(i=0;i<row;i++)
            {
                for(j=0;j<m;j++)
                {
                    cout<<a[ind];
                    ind++;
                }
                cout<<endl;
            }
            cout <<endl;

        }
        else {

            l = n%row;
            l = row-l;
            m++;
             ind=0;
            cout <<row <<" " <<m <<endl;
            for(i=0;i<row;i++)
            {
                for(j=0;j<m;j++)
                {
                    if(l>0)
                    {

                        if(j==m-1)
                        {
                            cout<<"*";
                            l--;
                        }
                        else {
                            cout <<a[ind] ;
                            ind++;
                        }
                    }
                    else{
                        cout <<a[ind] ;
                        ind++;
                    }

                }
                cout<<endl;

            }
        }

    }

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
string a;
int i,j,n,l,row,m;

int main()
{
    cin >> a;
    row=1;

    n=a.size();

    if(n<=20)
    {
        cout <<row <<" " <<n <<endl;
        cout<<a <<endl;
    }
    else{
        row++;
        m=n/row;
        while(m >= 20 )
        {
          row++ ;
          m=n/row;
         // if(row==5) break;
        }
        if(n%row ==0)
        {
            cout << row <<" " << m <<endl;
            for(i=0;i<row;i++)
            {
                for(j=0;j<m;j++)
                {
                    cout<<a[i*j+j];
                }
                cout<<endl;
            }
            cout <<endl;

        }
        else {

            l = n%row;
            l = row-l;
            m++;
            int ind=0;
            cout <<row <<" " <<m <<endl;
            for(i=0;i<row;i++)
            {
                for(j=0;j<m;j++)
                {
                    if(l>0)
                    {

                        if(j==m-1)
                        {
                            cout<<"*";
                            l--;
                        }
                        else {
                            cout <<a[ind] ;
                            ind++;
                        }
                    }
                    else{
                        cout <<a[ind] ;
                        ind++;
                    }

                }
                cout<<endl;

            }
        }

    }

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
string a;
int i,j,n,l,row,m;

int main()
{
    cin >> a;
    row=1;

    n=a.size();

    if(n<=20)
    {
        cout <<row <<" " <<n <<endl;
        cout<<a <<endl;
    }
    else{
        row++;
        m=n/row;
        while(m > 20 )
        {
          row++ ;
          m=n/row;
        }
        if(n%row ==0)
        {
            cout << row <<" " << m <<endl;
            for(i=0;i<row;i++)
            {
                for(j=0;j<m;j++)
                {
                    cout<<a[i*j+j];
                }
                cout<<endl;
            }
            cout <<endl;

        }
        else {

            l = n%row;
            l = row-l;
            m++;
            int ind=0;
            cout <<row <<" " <<m <<endl;
            for(i=0;i<row;i++)
            {
                for(j=0;j<m;j++)
                {
                    if(l>0)
                    {

                        if(j==m-1)
                        {
                            cout<<"*";
                            l--;
                        }
                        else {
                            cout <<a[ind] ;
                            ind++;
                        }
                    }
                    else{
                        cout <<a[ind] ;
                        ind++;
                    }

                }
                cout<<endl;

            }
        }

    }

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
string a;
int i,j,n,l,row,m;

int main()
{
    cin >> a;
    row=1;

    n=a.size();

    if(n<=20)
    {
        cout <<row <<" " <<n <<endl;
        cout<<a <<endl;
    }
    else{
        row++;
        m=n/row;
        while(m > 20 )
        {
          row++ ;
          m=n/row;

        }
        if(n%row ==0)
        {
            cout << row <<" " << m <<endl;
            for(i=0;i<row;i++)
            {
                for(j=0;j<m;j++)
                {
                    cout<<a[i*j+j];
                }
                cout<<endl;
            }
            cout <<endl;

        }
        else {

            l = n%row;
            l = row-l;
            m++;
            int ind=0;
            cout <<row <<" " <<m <<endl;
            for(i=0;i<row;i++)
            {
                for(j=0;j<m;j++)
                {
                    if(l>0)
                    {

                        if(j==m-1)
                        {
                            cout<<"*";
                            l--;
                        }
                        else {
                            cout <<a[ind] ;
                            ind++;
                        }
                    }
                    else{
                        cout <<a[ind] ;
                        ind++;
                    }

                }
                cout<<endl;

            }
        }

    }

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
string a;
int i,j,n,l,row,m,ind;

int main()
{
    cin >> a;
    row=1;

    n=a.size();
    ind=0;
    if(n<=20)
    {
        cout <<row <<" " <<n <<endl;
        cout<<a <<endl;
    }
    else{
        row++;
        m=n/row;
        while(m > 20 )
        {
          row++ ;
          m=n/row;

        }

        if(n%row ==0)
        {
            cout << row <<" " << m <<endl;
            for(i=0;i<row;i++)
            {
                for(j=0;j<m;j++)
                {
                    cout<<a[ind];
                    ind++;
                }
                cout<<endl;
            }
            cout <<endl;

        }
        else {
            if(m==20 && n%row!=0)
                {
                    row++;
                    m= n/row;
                }
            m++;
            l = n%row;
            l = row-l;

             ind=0;
            cout <<row <<" " <<m <<endl;
            for(i=0;i<row;i++)
            {
                for(j=0;j<m;j++)
                {
                    if(l>0)
                    {

                        if(j==m-1)
                        {
                            cout<<"*";
                            l--;
                        }
                        else {
                            cout <<a[ind] ;
                            ind++;
                        }
                    }
                    else{
                        cout <<a[ind] ;
                        ind++;
                    }

                }
                cout<<endl;

            }
        }

    }

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
string a;
int i,j,n,l,row,m,ind;

int main()
{
    cin >> a;
    row=1;

    n=a.size();
    ind=0;
    if(n<=20)
    {
        cout <<row <<" " <<n <<endl;
        cout<<a <<endl;
    }
    else{
        row++;
        m=n/row;
        while(m > 20 )
        {
          row++ ;
          m=n/row;

        }

        if(n%row ==0)
        {
            cout << row <<" " << m <<endl;
            for(i=0;i<row;i++)
            {
                for(j=0;j<m;j++)
                {
                    cout<<a[ind];
                    ind++;
                }
                cout<<endl;
            }
            cout <<endl;

        }
        else {
            if(m==20 && n%row!=0)row++;
            l = n%row;
            l = row-l;
            m++;
             ind=0;
            cout <<row <<" " <<m <<endl;
            for(i=0;i<row;i++)
            {
                for(j=0;j<m;j++)
                {
                    if(l>0)
                    {

                        if(j==m-1)
                        {
                            cout<<"*";
                            l--;
                        }
                        else {
                            cout <<a[ind] ;
                            ind++;
                        }
                    }
                    else{
                        cout <<a[ind] ;
                        ind++;
                    }

                }
                cout<<endl;

            }
        }

    }

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    string txt;
    cin >> txt;
    int l = txt.length();
    if (l < 21) cout << 1 << ' ' << l << "\n" << txt;
    else {
            int best = 10000, it;
        for (int i = 2; i < 6; ++i){
            if (i*20 >= l) {
                it = i;
                break;
            }
        }
        int row = (l + it - 1) / it;
        int gw = row * it - l;
        int k = 1;
        cout << it << ' ' << row << "\n";
        for (int i=0; i<l; ++i){
            cout << txt[i];
            if (i + 1 == row * k){
                k++;
                cout << "\n";
            }
        }
        for (int i=0; i<gw; ++i) cout << '*';
    }

}


#include <bits/stdc++.h>

using namespace std;

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    string txt;
    cin >> txt;
    int l = txt.length();
    if (l < 21) cout << 1 << ' ' << l << "\n" << txt;
    else {
            int best = 10000, it;
        for (int i = 2; i < 6; ++i){
            if (i*20 >= l) {
                it = i;
                break;
            }
        }
        int row = (l + it - 1) / it;
        int gw = row * it - l;
        int k = 1;
        for (int i=0; i<l; ++i){
            cout << txt[i];
            if (i + 1 == row * k){
                k++;
                cout << "\n";
            }
        }
        for (int i=0; i<gw; ++i) cout << '*';
    }

}


#include <bits/stdc++.h>

using namespace std;

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    string txt;
    cin >> txt;
    int l = txt.length();
    if (l < 21) cout << 1 << ' ' << l << "\n" << txt;
    else {
            int best = 10000, it;
        for (int i = 2; i < 6; ++i){
            if (best > (((l + i - 1) / i) * i) && ((l + i - 1) / i) < 21){
                it = i;
                best = (((l + i - 1) / i) * i);
            }
        }
        int gwiazdka = best - l;
        cout << it << ' ' << ((l + it - 1) / it) << "\n";
        int k = 1;
        for (int i = 0; i < l; ++i){
            cout << txt[i];
            if (i + 1 == ((l + it - 1) / it)*k){
                cout << "\n";
                k++;
            }
        }
        for (int i=0; i<gwiazdka; ++i) cout << '*';
    }

}


#include <bits/stdc++.h>

using namespace std;

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    string txt;
    cin >> txt;
    int l = txt.length();
    if (l < 21) cout << 1 << ' ' << l << "\n" << txt;
    else {
            int best = 10000, it;
        for (int i = 2; i < 6; ++i){
            if (i*20 >= l) {
                it = i;
                break;
            }
        }
        int row = (l + it - 1) / it;
        int gw = row * it - l;
        int gwi = 0;
        int k = 1;
        cout << it << ' ' << row << "\n";
        if (gw > 0){
            cout << '*';
            gw--;
            gwi++;
        }
        for (int i=0; i<l; ++i){
            cout << txt[i];
            if (i + 1 + gwi == row * k){
                k++;
                cout << "\n";
                if (gw > 0){
                cout << '*';
                gw--;
                gwi++;
                }
            }
        }
    }

}