#include<bits/stdc++.h>
using namespace std;
int main()
{
    char s[105];
    scanf("%s",s);
    int len=strlen(s);
    int col=len/20+(len%20!=0);
    int row=(len+col-1)/col;
    int res=col*row-len;
    int pos=0;
    printf("%d %d\n",col,row);
    for(int i=1;i<=col;i++)
    {
        for(int j=1;j<row;j++)
        {
            printf("%c",s[pos++]);
            if(j!=row-1)
                continue;
            if(res/col>=1)
                printf("*\n");
            else
                printf("%c\n",s[pos++]);
            res++;
        }
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    char s[105];
    scanf("%s",s);
    int len=strlen(s);
    int col=len/20+(len%20!=0);
    int row=(len+col-1)/col;
    int res=col*row-len;
    int pos=0;
    printf("%d %d\n",col,row);
    for(int i=1;i<=col;i++)
    {
        for(int j=1;j<=row;j++)
        {
            if(pos<len)
            printf("%c",s[pos++]);
            if(j!=row)
                continue;
            if(res/col>=1)
                printf("*\n");
            else
                printf("\n");
            res++;
        }
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    char s[105];
    scanf("%s",s);
    int len=strlen(s);
    int col=len/20+(len%20!=0);
    int row=(len+col-1)/col;
    int res=col*row-len;
    int pos=0;
    printf("%d %d\n",col,row);
    for(int i=1;i<=col;i++)
    {
        for(int j=1;j<row;j++)
        {
            printf("%c",s[pos++]);

        }

            if(res/col>=1)
                printf("*\n");
            else
                printf("%c\n",s[pos++]);
            res++;
    }
    return 0;
}


#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <string>
#include <string.h>
#include <math.h>
#include <functional>
using namespace std;
char arr[5][20];
int main() {
	string s;
	cin >> s;
	int rows = 0;
	int columns = INT_MAX;
	bool done = false;
	int length = s.length();
	for (int i = 1; i<= 5; i++) {
		for (int j = 1; j <= 20; j++) {
			if (i*j >= s.length() && j<columns) {
				rows = i;
				columns = j;
			}
		}
	}
	int start = 0;
	cout << rows << " " << columns << endl;
	for (int i = 1; i <= rows; i++) {
		for (int j = 1; j <= columns; j++) {
			if (start < length) {
				arr[i][j] = s[start];
				start++;
			}
			else {
				arr[i][j] = '*';
			}
		}
	}
	for (int i = 1; i <= rows; i++) {
		for (int j = 1; j <= columns; j++) {
			cout << arr[i][j] << "";
		}
		cout << endl;
	}
	return 0;
}


#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <string>
#include <string.h>
#include <math.h>
#include <functional>
using namespace std;
char arr[5][20];
int main() {
	string s;
	cin >> s;
	bool done = false;
	int length = s.length();
	int difference = 0;
	int rows = 0;
	int columns = 0;
	for (int i = 1; i <= 5; i++) {
		if (done)break;
		for (int j = 1; j <= 20; j++) {
			if (i*j >= s.length()) {
				done = true;
				difference = (i*j)-s.length();
				rows = i;
				columns = j;
				break;
				}

			}
		}

	int start = 0;
	cout << rows << "  " << columns << endl;
	int counter = 0;
	for (int i = 1; i <= rows; i++) {
		for (int j = 1; j <= columns; j++) {
			if (start < length ) {
				if (j != columns) {
					arr[i][j] = s[start];
					start++;
				}
				else {
					if (j == columns && counter == difference) {
						arr[i][j] = s[start];
						start++;
					}
				}
			}
			if (j == columns && counter<difference) {
				arr[i][j] = '*';
				counter++;
			}
		}
	}
	for (int i = 1; i <= rows; i++) {
		for (int j = 1; j <= columns; j++) {
			cout << arr[i][j] << "";
		}
		cout << endl;
	}
	return 0;
}


#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <string>
#include <string.h>
#include <math.h>
#include <functional>
using namespace std;
char arr[5][20];
vector <pair<int, int>> vecc;
int main() {
	string s;
	cin >> s;
	int rows = 0;
	int columns = 0;
	bool done = false;
	int length = s.length();
	for (int i = 1; i <= 5; i++) {
		if (done)break;
		for (int j = 1; j <= 20; j++) {
			if (i*j >= s.length()) {
				rows = i;
				columns = j;
				vecc.push_back(make_pair(rows, columns));
			}
		}
	}
	if (vecc.size() % 2 == 0) {
		rows = vecc[vecc.size() % 2].first;
		columns= vecc[vecc.size() % 2].second;
	}
	else {
		rows = vecc[ceil(vecc.size() % 2)].first;
		columns = vecc[ceil(vecc.size() % 2)].second;
	}
	int start = 0;
	cout << rows << " " << columns << endl;
	for (int i = 1; i <= rows; i++) {
		for (int j = 1; j <= columns; j++) {
			if (start < length) {
				arr[i][j] = s[start];
				start++;
			}
			else {
				arr[i][j] = '*';
			}
		}
	}
	for (int i = 1; i <= rows; i++) {
		for (int j = 1; j <= columns; j++) {
			cout << arr[i][j] << "";
		}
		cout << endl;
	}
	return 0;
}


#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <string>
#include <string.h>
#include <math.h>
#include <functional>
using namespace std;
char arr[5][20];
int main() {
	string s;
	cin >> s;
	int rows = 0;
	int columns = 0;
	bool done = false;
	int length = s.length();
	for (int i = 1; i<= 5; i++) {
		if (done)break;
		for (int j = 1; j <= 20; j++) {
			if (i*j >= s.length()) {
				rows = i;
				columns = j;
				done = true;
				break;
			}
		}
	}
	int start = 0;
	cout << rows << " " << columns << endl;
	for (int i = 1; i <= rows; i++) {
		for (int j = 1; j <= columns; j++) {
			if (start < length) {
				arr[i][j] = s[start];
				start++;
			}
			else {
				arr[i][j] = '*';
			}
		}
	}
	for (int i = 1; i <= rows; i++) {
		for (int j = 1; j <= columns; j++) {
			cout << arr[i][j] << "";
		}
		cout << endl;
	}
	return 0;
}


#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <string>
#include <string.h>
#include <math.h>
#include <functional>
using namespace std;
char arr[5][20];
int main() {
	string s;
	cin >> s;
	bool done = false;
	int length = s.length();
	int difference = INT_MAX;
	int rows = 0;
	int columns = 0;
	for (int i = 1; i <= 5; i++) {
		if (done)break;
		for (int j = 1; j <= 20; j++) {
			if (i*j == s.length()) {
				done = true;
				difference = 0;
				rows = i;
				columns = j;
				break;
				}
			else if (i*j > s.length() && (i*j)-s.length()<difference) {
				if ((i*j) - s.length() <= columns) {
					difference = (i*j) - s.length();
					rows = i;
					columns = j;
				}
			}
			}
		}

	int start = 0;
	cout << rows << "  " << columns << endl;
	for (int i = 1; i <= difference; i++) {
		arr[1][i] = '*';
	}
	for (int i = difference+1; i <= columns; i++) {
		arr[1][i] = s[start];
		start++;
	}
	for (int i = 2; i <= rows; i++) {
		for (int j = 1; j <= columns; j++) {
			if (start < length) {
				arr[i][j] = s[start];
				start++;
			}
		}
	}
	for (int i = 1; i <= rows; i++) {
		for (int j = 1; j <= columns; j++) {
			cout << arr[i][j] << "";
		}
		cout << endl;
	}
	return 0;
}


#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <string>
#include <string.h>
#include <math.h>
#include <functional>
using namespace std;
char arr[5][20];
int main() {
	string s;
	cin >> s;
	bool done = false;
	int length = s.length();
	int difference = 0;
	int rows = 0;
	int columns = 0;
	for (int i = 1; i <= 5; i++) {
		if (done)break;
		for (int j = 1; j <= 20; j++) {
			if (i*j >= s.length()) {
				done = true;
				difference = (i*j)-s.length();
				rows = i;
				columns = j;
				break;
				}

			}
		}

	int start = 0;
	cout << rows << "  " << columns << endl;
	for (int i = 1; i <= difference; i++) {
		arr[1][i] = '*';
	}
	for (int i = difference+1; i <= columns; i++) {
		arr[1][i] = s[start];
		start++;
	}
	for (int i = 2; i <= rows; i++) {
		for (int j = 1; j <= columns; j++) {
			if (start < length) {
				arr[i][j] = s[start];
				start++;
			}
		}
	}
	for (int i = 1; i <= rows; i++) {
		for (int j = 1; j <= columns; j++) {
			cout << arr[i][j] << "";
		}
		cout << endl;
	}
	return 0;
}


#include<iostream>
#include<string>
using namespace std;
string s;
int dot;
void print(int i,int len)
{
	cout<<i<<" "<<len/i<<endl;
		int alen=0;
		for(int k=0;k<i;k++)
		{
			int ll=alen+len/i;
			if(i-dot<=0)ll-=1;
			for(int j=alen;j<ll;j++)
			{
				cout<<s[j];
			}
			if(i-dot<=0)cout<<"*";
			cout<<endl;
			alen+=len/i;
			dot++;
		}
}
int main()
{
	cin>>s;
	int len=s.size();
	int line=len/20;
	if(len%20==0)
	{
		print(line,len);
	}
	else
	{
		line++;
		if(line==1)
		{
			print(line,len);
		}
		else
		{
			if(len%line==0)
			{
				print(line,len);
			}
			else
			{
			//	cout<<len<<endl;
				dot=(len/line+1)*line-len;
			//	cout<<dot<<endl;
				print(line,len+dot);
			}
		}
	}

	return 0;
 }


#include<iostream>
#include<string>
using namespace std;
string s;
int dot;
void print(int i,int len)
{
	cout<<i<<" "<<len/i<<endl;
		int alen=0;
		for(int k=0;k<i;k++)
		{
			int ll=alen+len/i;
			if(i-dot<=0)ll-=1;
			for(int j=alen;j<ll;j++)
			{
				cout<<s[j];
			}
			if(i-dot<=0)
			{
				cout<<"*";
				alen--;
			}
			cout<<endl;
			alen+=len/i;
			dot++;
		}
}
int main()
{
	cin>>s;
	int len=s.size();
	int line=len/20;
	if(len%20==0)
	{
		print(line,len);
	}
	else
	{
		line++;
		if(line==1)
		{
			print(line,len);
		}
		else
		{
			if(len%line==0)
			{
				print(line,len);
			}
			else
			{
				cout<<len<<endl;
				dot=(len/line+1)*line-len;
			//	cout<<dot<<endl;
				print(line,len+dot);
			}
		}
	}

	return 0;
 }


#include<iostream>
#include<string>
using namespace std;
string s;
int dot;
void print(int i,int len)
{
	cout<<i<<" "<<len/i<<endl;
		int alen=0;
		for(int k=0;k<i;k++)
		{
			int ll=alen+len/i;
			if(i-dot<=0)ll-=1;
			for(int j=alen;j<ll;j++)
			{
				cout<<s[j];
			}
			if(i-dot<=0)
			{
				cout<<"*";
				alen--;
			}
			cout<<endl;
			alen+=len/i;
			dot++;
		}
}
int main()
{
	cin>>s;
		s.push_back('t');
	int len=s.size();
	int line=len/20;
	if(len%20==0)
	{
		print(line,len);
	}
	else
	{
		line++;
		if(line==1)
		{
			print(line,len);
		}
		else
		{
			if(len%line==0)
			{
				print(line,len);
			}
			else
			{
			//	cout<<len<<endl;
				dot=(len/line+1)*line-len;
			//	cout<<dot<<endl;
				print(line,len+dot);
			}
		}
	}
	return 0;
 }


#include<iostream>
#include<string>
using namespace std;
string s;
int dot;
void print(int i,int len)
{
	cout<<i<<" "<<len/i<<endl;
		int alen=0;
		for(int k=0;k<i;k++)
		{
			int ll=alen+len/i;
			if(i-dot<=0)ll-=1;
			for(int j=alen;j<ll;j++)
			{
				cout<<s[j];
			}
			if(i-dot<=0)
			{
				cout<<"*";
				alen--;
			}
			cout<<endl;
			alen+=len/i;
			dot++;
		}
}
int main()
{
	cin>>s;
	int len=s.size();
	int line=len/20;
	if(len%20==0)
	{
		print(line,len);
	}
	else
	{
		line++;
		if(line==1)
		{
			print(line,len);
		}
		else
		{
			if(len%line==0)
			{
				print(line,len);
			}
			else
			{
		//		cout<<len<<endl;
				dot=(len/line+1)*line-len;
			//	cout<<dot<<endl;
				print(line,len+dot);
			}
		}
	}

	return 0;
 }


#include<bits/stdc++.h>
using namespace std;
int main()
{
  string s;
  cin>>s;
  int n=s.length();int i=0;int k=n/20;if(n%20!=0)k++;int l=0;
  if(n%k!=0){l=k-n%k;n+=l;}
  int c=n/k;
  int row=k;int col=c;
  cout<<row<<" "<<col<<endl;
  while(i<s.length())
  {
    col=c;
  	while(row--)
  	{
  		col=c;
  		if(l>0)
  		{
  		  cout<<'*';l--;col--;
  		}
  		while(col--)
  		{
          cout<<s[i];i++;if(i==s.length())return 0;
        }
  	   cout<<endl;
  	}
  }

}


#include<bits/stdc++.h>
using namespace std;
int main()
{
  string s;
  cin>>s;
  int n=s.length();int i=0;int k=n/20;if(n%20!=0)k++;int l=0;
  if(n%k!=0){l=k-n%k;n+=l;}
  int c=n/k;
  int row=k;int col=c;
  cout<<row<<" "<<col<<endl;
  while(i<n)
  {
    col=c;
  	while(row--)
  	{
  		col=c;
  		while(col--)
  		{
  			if(l>0)
  			{
  				cout<<'*';l--;
  			}
  			else
  			{
  				cout<<s[i];i++;
  			}
  			  		if(i==n)return 0;

  		}

  		cout<<endl;
  	}

  }

}


#include<bits/stdc++.h>
using namespace std;
int main()
{
  string s;
  cin>>s;
  int n=s.length();int i=0;int k=n/20;if(n%20!=0)k++;int l=0;
  if(n%k!=0){l=k-n%k;n+=l;}
  int c=n/k;
  int row=k;int col=c;
  cout<<row<<" "<<col<<endl;
  while(i<n)
  {
    col=c;
  	while(row-- and i<n)
  	{
  		col=c;
  		while(col-- and i<n)
  		{
  			if(l>0)
  			{
  				cout<<'*';l--;
  			}
  			else
  			{
  				cout<<s[i];i++;

  			}
  	    }
  	    if(i<n-1)cout<<endl;
  	    else return 0;
  	}
  }

}


#include<bits/stdc++.h>
using namespace std;
int main()
{
  string s;
  cin>>s;
  int n=s.length();int i=0;int k=n/20;if(n%20!=0)k++;int l=0;
  if(n%k!=0){l=k-n%k;n+=l;}
  int c=n/k;
  int row=k;int col=c;
  cout<<row<<" "<<col<<endl;
  while(i<s.length())
  {
    col=c;
  	while(row-- and i<n)
  	{
  		col=c;
  		if(l>0)
  		{
  		  cout<<'*';l--;col--;
  		}
  		while(col-- and i<n)
  		{
          cout<<s[i];i++;if(i==s.length())return 0;
        }
  	   cout<<endl;
  	}
  }

}


#include<bits/stdc++.h>
using namespace std;
int main()
{
  string s;
  cin>>s;
  int n=s.length();int i=0;int k=n/20;if(n%20!=0)k++;int l=0;
  if(n%k!=0){l=k-n%k;n+=l;}
  int c=n/k;
  int row=k;int col=c;
  cout<<row<<" "<<col<<endl;
  while(i<n)
  {
    col=c;if(i==n)return 0;
  	while(row--)
  	{
  		if(i==n)return 0;
  		col=c;
  		while(col--)
  		{
  			if(i==n)return 0;
  			if(l>0)
  			{
  				cout<<'*';l--;
  			}
  			else
  			{
  				cout<<s[i];i++;
  			}
  			  		if(i==n)return 0;

  		}

  		cout<<endl;
  	}

  }

}


#include <iostream>
#include <string>
using namespace std;
string s;
int rows, cols;
int main()
{
	cin >> s;
	rows = s.length() / 20 + (s.length() % 20 > 0 ? 1:0);
	cols = s.length() / rows + (s.length() % rows > 0 ? 1:0);
	cout << rows << " " << cols << endl;
	for (int i = 0; i < rows - 1; i++)
	{
		cout << s.substr((i*cols), cols)<<endl;
	}
	cout << s.substr((rows - 1)*cols);
	for (int i = 0; i < cols - (s.length() - (rows - 1)*cols) ; i++)
	{
		cout << "*";
	}
	cout << endl;
	//system("pause");
}


#include <iostream>
#include <string>
using namespace std;
string s;
int rows, cols;
int main()
{
	cin >> s;
	rows = s.length() / 20 + (s.length() % 20 > 0 ? 1:0);
	cols = s.length() / rows + (s.length() % rows > 0 ? 1:0);
	cout << rows << " " << cols << endl;
	for (int i = 0; i < rows - 1; i++)
	{
		cout << s.substr((i*cols), cols)<<endl;
	}
	cout << s.substr((rows - 1)*cols)<<endl;
	//system("pause");
}


#include <iostream>
#include <string>
using namespace std;
string s;
int rows, cols, numA;
int main()
{
	//	for(int i=0;i<100;i++)
		//{
	cin >> s;
	//s += "j";
	rows = s.length() / 20 + (s.length() % 20 > 0 ? 1 : 0);
	cols = s.length() / rows + (s.length() % rows > 0 ? 1 : 0);
	numA = cols - s.length() + (rows - 1)*cols;
	cout << rows << " " << cols << endl;
	for (int i = 0; i < rows - numA; i++)
	{
		cout << s.substr((i*cols), cols) << endl;
	}
	for (int i = rows - numA ;i < rows; i++)
	{
		cout << s.substr((i*(cols-1)), cols - 1) << "*" << endl;
	}
	cout << endl;
	//system("pause");
	//}
}


#include <iostream>
#include <string>
using namespace std;
string s;
int rows, cols, numA;
int main()
{
	//	for(int i=0;i<100;i++)
		//{
	cin >> s;
	//s += "j";
	rows = s.length() / 20 + (s.length() % 20 > 0 ? 1 : 0);
	cols = s.length() / rows + (s.length() % rows > 0 ? 1 : 0);
	numA = cols - s.length() + (rows - 1)*cols;
	cout << rows << " " << cols << endl;
	for (int i = 0; i < rows - numA; i++)
	{
		cout << s.substr((i*cols), cols) << endl;
	}
	int start = (rows - numA)*cols;
	for (int i = rows - numA ;i < rows; i++)
	{
		cout << s.substr((start + (i-rows+numA)*(cols-1)), cols - 1) << "*" << endl;
	}
	cout << endl;
	//system("pause");
	//}
}


#include <iostream>
#include <vector>
#include <algorithm>
#include <string.h>
#include <stdio.h>
#include <cmath>
#include <math.h>
#include <sstream>
#include <iomanip>
#include <time.h>
#include <fstream>

using namespace std;

int main() {
	string handle;
	cin>>handle;
	int l = handle.length();
	int r = (l + 19) / 20;
	int c = (l + r - 1)/r;
	cout<<r<<" "<<c<<endl;
	int a = r * c - l;
	int extra = a - (a / r) * r;
	int ptr = 0;
	for(int i = 0; i < r; i++){
		int left = c;
		for (int k = 0; k < (a/r); k++){
			cout<<"*";
		}
		left -= a/r;
		if (extra != 0){
			cout<<"*";
			extra--;
			left--;
		}
		for (int j = 0; j < left; j++){
			cout<<handle[ptr];
			ptr++;
		}
		cout<<endl;
	}
	return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>
#include <string.h>
#include <stdio.h>
#include <cmath>
#include <math.h>
#include <sstream>
#include <iomanip>
#include <time.h>
#include <fstream>

using namespace std;

int main() {
	string handle;
	cin>>handle;
	int l = handle.length();
	int r = (l + 19) / 20;
	int c = (l + r - 1)/r;
	cout<<r<<" "<<c<<endl;
	int a = r * c - l;
	int extra = a - (a / r) * r;
	int ptr = 0;
	for(int i = 0; i < r; i++){
		int left = c;
		for (int k = 0; k < (a/r); k++){
			cout<<"*";
		}
		left -= a;
		if (extra != 0){
			cout<<"*";
			extra--;
			left--;
		}
		for (int j = 0; j < left; j++){
			cout<<handle[ptr];
			ptr++;
		}
		cout<<endl;
	}
	return 0;
}


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

typedef long long ll;
typedef pair <int, int> pi;
constexpr double PI = atan(1) * 4;
constexpr int inf = 0x3f3f3f3f;
inline int LSB(int i) {return (i & -i);}

string s;
queue <char> q;
int a, b, num, gap, cnt = 1;

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

    cin >> s;
    num = s.length();
    for(int i = 0; i < num; i++) q.push(s[i]);
    for(int i = 1; i <= 5; i++){
        if(ceil((num * 1.0) / (i * 1.0)) <= 20 && !a && !b){
            a = i;
            b = ceil((num * 1.0) / (i * 1.0));
        }
    }

    cout << a << " " << b << endl;
    gap = (a * b) - num;
    for(int i = 0; i < a; i++){
        bool sub = false;
        for(int j = 0; j < b; j++){
            if(gap > 0 && !sub){
                cout << "*";
                gap--;
                cnt--;
                if(!cnt){
                    sub = true;
                    if(gap > 2) cnt = 2;
                    else cnt = 1;
                }
            }
            else{
                cout << q.front();
                q.pop();
            }
        }
        cout << endl;
    }
    return 0;
}


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

typedef long long ll;
typedef pair <int, int> pi;
constexpr double PI = atan(1) * 4;
constexpr int inf = 0x3f3f3f3f;
inline int LSB(int i) {return (i & -i);}

string s;
queue <char> q;
int a, b, num, gap, cnt = 1;

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

    cin >> s;
    num = s.length();
    for(int i = 0; i < num; i++) q.push(s[i]);
    for(int i = 1; i <= 5; i++){
        if(ceil((num * 1.0) / (i * 1.0)) <= 20 && !a && !b){
            a = i;
            b = ceil((num * 1.0) / (i * 1.0));
        }
    }

    cout << a << " " << b << endl;
    gap = (a * b) - num;
    for(int i = 0; i < a; i++){
        bool sub = false;
        for(int j = 0; j < b; j++){
            if(gap > 0 && !sub){
                for(int k = 0; k < min(cnt, gap); k++) cout << "*";
                j += min(cnt, gap) - 1;
                gap -= cnt;
                cnt = ((cnt == 1) ? 2 : 1);
                sub = true;
            }
            else{
                cout << q.front();
                q.pop();
            }
        }
        cout << endl;
    }
    return 0;
}


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

typedef long long ll;
typedef pair <int, int> pi;
constexpr double PI = atan(1) * 4;
constexpr int inf = 0x3f3f3f3f;
inline int LSB(int i) {return (i & -i);}

string s;
queue <char> q;
int a, b, num, gap, cnt = 1;

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

    cin >> s;
    num = s.length();
    for(int i = 0; i < num; i++) q.push(s[i]);
    for(int i = 1; i <= 5; i++){
        if((num * 1.0) / (i * 1.0) <= 20 && !a){
            a = i;
            b = ceil((num * 1.0) / (i * 1.0));
        }
    }
    cout << a << " " << b << endl;
    gap = (a * b) - num;
    for(int i = 0; i < a; i++){
        bool sub = false;
        for(int j = 0; j < b; j++){
            if(gap && !sub){
                for(int k = 0; k < min(cnt, gap); k++) cout << "*";
                gap -= cnt;
                cnt++;
                sub = true;
            }
            else{
                cout << q.front();
                q.pop();
            }
        }
        cout << endl;
    }
    return 0;
}


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

typedef long long ll;
typedef pair <int, int> pi;
constexpr double PI = atan(1) * 4;
constexpr int inf = 0x3f3f3f3f;
inline int LSB(int i) {return (i & -i);}

string s;
queue <char> q;
int a, b, num, gap, cnt = 1;

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

    cin >> s;
    num = s.length();
    for(int i = 0; i < num; i++) q.push(s[i]);
    for(int i = 1; i <= 5; i++){
        if((num * 1.0) / (i * 1.0) <= 20 && !a){
            a = i;
            b = ceil((num * 1.0) / (i * 1.0));
        }
    }
    cout << a << " " << b << endl;
    gap = (a * b) - num;
    for(int i = 0; i < a; i++){
        bool sub = false;
        for(int j = 0; j < b; j++){
            if(gap && !sub){
                for(int k = 0; k < min(cnt, gap); k++) cout << "*";
                gap -= cnt;
                cnt = (cnt == 1) ? 2 : 1;
                sub = true;
            }
            else{
                cout << q.front();
                q.pop();
            }
        }
        cout << endl;
    }
    return 0;
}


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

typedef long long ll;
typedef pair <int, int> pi;
constexpr double PI = atan(1) * 4;
constexpr int inf = 0x3f3f3f3f;
inline int LSB(int i) {return (i & -i);}

string s;
queue <char> q;
int a, b, num, gap, cnt = 1, sw = 2;

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

    cin >> s;
    num = s.length();
    for(int i = 0; i < num; i++) q.push(s[i]);
    for(int i = 1; i <= 5; i++){
        if(ceil((num * 1.0) / (i * 1.0)) <= 20 && !a && !b){
            a = i;
            b = ceil((num * 1.0) / (i * 1.0));
        }
    }

    cout << a << " " << b << endl;
    gap = (a * b) - num;
    for(int i = 0; i < a; i++){
        bool sub = false;
        for(int j = 0; j < b; j++){
            if(gap > 0 && !sub){
                cout << "*";
                gap--;
                cnt--;
                if(!cnt){
                    sub = true;
                    cnt = sw;
                    sw = (sw == 1) ? 2 : 1;
                }
            }
            else{
                cout << q.front();
                q.pop();
            }
        }
        cout << endl;
    }
    return 0;
}


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

typedef long long ll;
typedef pair <int, int> pi;
constexpr double PI = atan(1) * 4;
constexpr int inf = 0x3f3f3f3f;
inline int LSB(int i) {return (i & -i);}

string s;
queue <char> q;
int a, b, num, gap;

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

    cin >> s;
    num = s.length();
    for(int i = 0; i < num; i++) q.push(s[i]);
    for(int i = 1; i <= 5; i++){
        if(ceil((num * 1.0) / (i * 1.0)) <= 20 && !a && !b){
            a = i;
            b = ceil((num * 1.0) / (i * 1.0));
        }
    }

    cout << a << " " << b << endl;
    gap = (a * b) - num;
    for(int i = 0; i < a; i++){
        bool sub = false;
        for(int j = 0; j < b; j++){
            if(gap > 0 && !sub){
                cout << "*";
                gap--;
                sub = true;
            }
            else{
                cout << q.front();
                q.pop();
            }
        }
        cout << endl;
    }
    return 0;
}


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

typedef long long ll;
typedef pair <int, int> pi;
constexpr double PI = atan(1) * 4;
constexpr int inf = 0x3f3f3f3f;
inline int LSB(int i) {return (i & -i);}

string s;
queue <char> q;
int a, b, num, gap, cnt = 1;

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

    cin >> s;
    num = s.length();
    for(int i = 0; i < num; i++) q.push(s[i]);
    for(int i = 1; i <= 5; i++){
        if((num * 1.0) / (i * 1.0) <= 20 && !a && !b){
            a = i;
            b = ceil((num * 1.0) / (i * 1.0));
        }
    }
    cout << a << " " << b << endl;
    gap = (a * b) - num;
    for(int i = 0; i < a; i++){
        bool sub = false;
        for(int j = 0; j < b; j++){
            if(gap && !sub){
                for(int k = 0; k < min(cnt, gap); k++) cout << "*";
                j += min(cnt, gap) - 1;
                gap -= cnt;
                cnt = (cnt == 1) ? 2 : 1;
                sub = true;
            }
            else{
                cout << q.front();
                q.pop();
            }
        }
        cout << endl;
    }
    return 0;
}


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

typedef long long ll;
typedef pair <int, int> pi;
constexpr double PI = atan(1) * 4;
constexpr int inf = 0x3f3f3f3f;
inline int LSB(int i) {return (i & -i);}

string s;
queue <char> q;
int a, b, num, gap, cnt = 1;

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

    cin >> s;
    num = s.length();
    for(int i = 0; i < num; i++) q.push(s[i]);
    for(int i = 1; i <= 5; i++){
        if((num * 1.0) / (i * 1.0) <= 20 && !a && !b){
            a = i;
            b = ceil((num * 1.0) / (i * 1.0));
        }
    }
    cout << a << " " << b << endl;
    gap = (a * b) - num;
    for(int i = 0; i < a; i++){
        bool sub = false;
        for(int j = 0; j < b; j++){
            if(gap && !sub){
                for(int k = 0; k < min(cnt, gap); k++) cout << "*";
                j += min(cnt, gap);
                gap -= cnt;
                cnt = (cnt == 1) ? 2 : 1;
                sub = true;
            }
            else{
                cout << q.front();
                q.pop();
            }
        }
        cout << endl;
    }
    return 0;
}


#include <bits/stdc++.h>
const int maxn = 1007;
char str[maxn];
struct Node {
	int cnt, n, m;
	bool operator < (const Node &tmp) const {
		return cnt < tmp.cnt;
	}
} node[maxn];
int row[maxn];
int main() {
	scanf("%s", str);
	bool flag = true;
	int n, m, len = int(strlen(str)), tot = 0;
	for (n = 1; n <= 5 && flag; n++) {
		for (m = 1; m <= 20 && flag; m++) {
			node[++tot] = {n * m, n, m};
		}
	}
	std::sort(node + 1, node + 1 + tot);
	for (int i = 1; i <= tot; i++) {
		if (node[i].cnt >= len) {
			n = node[i].n, m = node[i].m;
			break;
		}
	}
	printf("%d %d\n", n, m);
	int last = n * m - len, cur = 0;
	for (int i = 1; i <= n; i++) row[i] = last / n;
	for (int i = 1; i <= n; i++) {
		int need = m - row[i];
		while (need--) putchar(str[cur++]);
		while (row[i]--) putchar('*');
		putchar('\n');
	}
	return 0;
}


#include <bits/stdc++.h>
const int maxn = 1007;
char str[maxn];
struct Node {
	int cnt, n, m;
	bool operator < (const Node &tmp) const {
		return cnt < tmp.cnt;
	}
} node[maxn];
int row[maxn];
int main() {
	scanf("%s", str);
	bool flag = true;
	int n, m, len = int(strlen(str)), tot = 0;
	for (n = 1; n <= 5 && flag; n++) {
		for (m = 1; m <= 20 && flag; m++) {
			node[++tot] = {n * m, n, m};
		}
	}
	std::sort(node + 1, node + 1 + tot);
	for (int i = 1; i <= tot; i++) {
		if (node[i].cnt >= len) {
			n = node[i].n, m = node[i].m;
			break;
		}
	}
	int last = n * m - len, cur = 0;
	for (int i = 1; i <= n; i++) row[i] = last / n;
	for (int i = 1; i <= n; i++) {
		int need = m - row[i];
		while (need--) putchar(str[cur++]);
		while (row[i]--) putchar('*');
		putchar('\n');
	}
	return 0;
}


#include <bits/stdc++.h>
const int maxn = 1007;
char str[maxn];
int row[maxn];
int main() {
	scanf("%s", str);
	bool flag = true;
	int len = int(strlen(str));
	for (int n = 1; n <= 5 && flag; n++) {
		for (int m = 1; m <= 20 && flag; m++) {
			if (n * m >= len) {
				printf("%d %d\n", n, m);
				int last = n * m - len, cur = 0;
				for (int i = 1; i <= n; i++) row[i] = last / n;
				for (int i = 1; i <= last % n; i++) row[i]++;
				for (int i = 1; i <= n; i++) {
					int need = m - row[i];
					while (need--) putchar(str[cur++]);
					while (row[i]--) putchar('*');
					putchar('\n');
				}
				flag = false;
			}
		}
	}
	return 0;
}


#include <bits/stdc++.h>
#define CIOS ios::sync_with_stdio(false);
#define For(i, a, b) for(register int i = a; i <= b; i++)
#define Rof(i, a, b) for(register int i = a; i >= b; i--)
#define DEBUG(x) cerr << "DEBUG" << x << " >>> ";
using namespace std;

typedef unsigned long long ull;
typedef long long ll;

template <typename T>
inline void read(T &f) {
	f = 0; T fu = 1; char c = getchar();
	while(c < '0' || c > '9') {if(c == '-') fu = -1; c = getchar();}
	while(c >= '0' && c <= '9') {f = (f << 3) + (f << 1) + (c & 15); c = getchar();}
	f *= fu;
}

template <typename T>
void print(T x) {
	if(x < 0) putchar('-'), x = -x;
	if(x < 10) putchar(x + 48);
	else print(x / 10), putchar(x % 10 + 48);
}

template <typename T>
void print(T x, char t) {
	print(x); putchar(t);
}

const int N = 105;

char c[N];
int n;

int main() {
	scanf("%s", c + 1); n = strlen(c + 1); int now = 0;
	for(register int i = 1; i <= 5; i++) {
		if((n + i - 1) / i > 20) continue;
		int maxlen = (n + i - 1) / i;
		int qwq = n % (maxlen - 1);
		cout << i << " " << maxlen << endl;
		for(register int j = 1; j <= qwq; j++) {
			for(register int j = 1; j <= maxlen; j++) {
				now++;
				putchar(c[now]);
			}
			putchar('\n');
		}
		for(register int j = qwq + 1; j <= i; j++) {
			putchar('*');
			for(register int j = 2; j <= maxlen; j++) {
				now++;
				putchar(c[now]);
			}
			putchar('\n');
		}
		break;
	}
	return 0;
}


#include <bits/stdc++.h>
#define CIOS ios::sync_with_stdio(false);
#define For(i, a, b) for(register int i = a; i <= b; i++)
#define Rof(i, a, b) for(register int i = a; i >= b; i--)
#define DEBUG(x) cerr << "DEBUG" << x << " >>> ";
using namespace std;

typedef unsigned long long ull;
typedef long long ll;

template <typename T>
inline void read(T &f) {
	f = 0; T fu = 1; char c = getchar();
	while(c < '0' || c > '9') {if(c == '-') fu = -1; c = getchar();}
	while(c >= '0' && c <= '9') {f = (f << 3) + (f << 1) + (c & 15); c = getchar();}
	f *= fu;
}

template <typename T>
void print(T x) {
	if(x < 0) putchar('-'), x = -x;
	if(x < 10) putchar(x + 48);
	else print(x / 10), putchar(x % 10 + 48);
}

template <typename T>
void print(T x, char t) {
	print(x); putchar(t);
}

const int N = 105;

char c[N];
int n;

int main() {
	scanf("%s", c + 1); n = strlen(c + 1); int now = 0;
	for(register int i = 1; i <= 5; i++) {
		if((n + i - 1) / i > 20) continue;
		int maxlen = (n + i - 1) / i;
		int qwq = (n - 1) % i + 1;
		cout << i << " " << maxlen << endl;
		for(register int j = 1; j <= qwq; j++) {
			for(register int j = 1; j <= maxlen; j++) {
				now++;
				putchar(c[now]);
			}
			putchar('\n');
		}
		for(register int j = qwq + 1; j <= i; j++) {
			putchar('*');
			for(register int j = 2; j <= maxlen; j++) {
				now++;
				putchar(c[now]);
			}
			putchar('\n');
		}
		break;
	}
	return 0;
}


#include <bits/stdc++.h>
#define CIOS ios::sync_with_stdio(false);
#define For(i, a, b) for(register int i = a; i <= b; i++)
#define Rof(i, a, b) for(register int i = a; i >= b; i--)
#define DEBUG(x) cerr << "DEBUG" << x << " >>> ";
using namespace std;

typedef unsigned long long ull;
typedef long long ll;

template <typename T>
inline void read(T &f) {
	f = 0; T fu = 1; char c = getchar();
	while(c < '0' || c > '9') {if(c == '-') fu = -1; c = getchar();}
	while(c >= '0' && c <= '9') {f = (f << 3) + (f << 1) + (c & 15); c = getchar();}
	f *= fu;
}

template <typename T>
void print(T x) {
	if(x < 0) putchar('-'), x = -x;
	if(x < 10) putchar(x + 48);
	else print(x / 10), putchar(x % 10 + 48);
}

template <typename T>
void print(T x, char t) {
	print(x); putchar(t);
}

const int N = 105;

char c[N];
int n;

int main() {
	scanf("%s", c + 1); n = strlen(c + 1); int now = 0;
	for(register int i = 1; i <= 5; i++) {
		if((n + i - 1) / i > 20) continue;
		int maxlen = (n + i - 1) / i;
		int qwq = n % (maxlen - 1);
		cerr << i << " " << maxlen << endl;
		for(register int j = 1; j <= qwq; j++) {
			for(register int j = 1; j <= maxlen; j++) {
				now++;
				putchar(c[now]);
			}
			putchar('\n');
		}
		for(register int j = qwq + 1; j <= i; j++) {
			putchar('*');
			for(register int j = 2; j <= maxlen; j++) {
				now++;
				putchar(c[now]);
			}
			putchar('\n');
		}
		break;
	}
	return 0;
}


#include <bits/stdc++.h>
#define CIOS ios::sync_with_stdio(false);
#define For(i, a, b) for(register int i = a; i <= b; i++)
#define Rof(i, a, b) for(register int i = a; i >= b; i--)
#define DEBUG(x) cerr << "DEBUG" << x << " >>> ";
using namespace std;

typedef unsigned long long ull;
typedef long long ll;

template <typename T>
inline void read(T &f) {
	f = 0; T fu = 1; char c = getchar();
	while(c < '0' || c > '9') {if(c == '-') fu = -1; c = getchar();}
	while(c >= '0' && c <= '9') {f = (f << 3) + (f << 1) + (c & 15); c = getchar();}
	f *= fu;
}

template <typename T>
void print(T x) {
	if(x < 0) putchar('-'), x = -x;
	if(x < 10) putchar(x + 48);
	else print(x / 10), putchar(x % 10 + 48);
}

template <typename T>
void print(T x, char t) {
	print(x); putchar(t);
}

const int N = 105;

char c[N];
int n;

int main() {
	scanf("%s", c + 1); n = strlen(c + 1); int now = 0;
	for(register int i = 1; i <= 5; i++) {
		if((n + i - 1) / i > 20) continue;
		int maxlen = (n + i - 1) / i;
		int qwq = i - n % i;
		cout << i << " " << maxlen << endl;
		for(register int j = 1; j <= qwq; j++) {
			for(register int j = 1; j <= maxlen; j++) {
				now++;
				putchar(c[now]);
			}
			putchar('\n');
		}
		for(register int j = qwq + 1; j <= i; j++) {
			putchar('*');
			for(register int j = 2; j <= maxlen; j++) {
				now++;
				putchar(c[now]);
			}
			putchar('\n');
		}
		break;
	}
	return 0;
}


#include <algorithm>
#include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
char s[200];
int main()
{
    cin >> s;
    int len = strlen(s);
    int fuck = 1;
    while (len / fuck > 20 || (len/fuck==20 && len%fuck)){
        (++fuck);
    }

    int remain = len % fuck;
    if (remain == 0) {
        printf("%d %d\n", fuck, len / fuck);
        for (int i = 0; i < fuck; i++) {
            for (int j = 0; j < len / fuck; j++) {
                putchar(s[i * len / fuck + j]);
            }
            putchar('\n');
        }
    } else {
        printf("%d %d\n", fuck, len / fuck + 1);
        int z = 0;
        for (int i = 0; i < remain; i++) {
            for (int j = 0; j < len / fuck + 1; j++) {
                putchar(s[z++]);
            }
            putchar('\n');
        }
        for (int i = fuck - remain; i > 0; i--) {
            for (int j = 0; j < len / fuck; j++) {
                putchar(s[z++]);
            }
            printf("*\n");
        }
    }
}


#include <algorithm>
#include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
char s[200];
int main()
{
    cin >> s;
    int len = strlen(s);
    int fuck = 1;
    while (len / fuck > 20)
        (++fuck);
    int remain = len % fuck;
    if (remain == 0) {
        printf("%d %d\n", fuck, len / fuck);
        for (int i = 0; i < fuck; i++) {
            for (int j = 0; j < len / fuck; j++) {
                putchar(s[i * len / fuck + j]);
            }
            putchar('\n');
        }
    } else {
        printf("%d %d\n", fuck, len / fuck + 1);
        int z = 0;
        for (int i = 0; i < remain; i++) {
            for (int j = 0; j < len / fuck + 1; j++) {
                putchar(s[z++]);
            }
            putchar('\n');
        }
        for (int i = fuck - remain; i > 0; i--) {
            for (int j = 0; j < len / fuck; j++) {
                putchar(s[z++]);
            }
            printf("*\n");
        }
    }
}


#include <algorithm>
#include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
char s[200];
int main()
{
    cin >> s;
    int len = strlen(s);
    int fuck = 1;
    while (len / fuck > 20)
        (++fuck);
    int remain = len % fuck;
    if (remain == 0) {
        for (int i = 0; i < fuck; i++) {
            for (int j = 0; j < len / fuck; j++) {
                putchar(s[i * len / fuck + j]);
            }
            putchar('\n');
        }
    } else {
        int z = 0;
        for (int i = 0; i < remain; i++) {
            for (int j = 0; j < len / fuck + 1; j++) {
                putchar(s[z++]);
            }
            putchar('\n');
        }
        for (int i = fuck - remain; i > 0; i--) {
            for (int j = 0; j < len / fuck; j++) {
                putchar(s[z++]);
            }
            printf("*\n");
        }
    }
}


/**
 *    +--+--+--++--++--In the name of ALLAH--++--++--+--+--+
 *
 *    author:  skmonir
 *    created: 18-Nov-2018 22:54:41
**/

#include <bits/stdc++.h>

using namespace std;

#define endl                '\n'
#define TN                  typename
#define mod                 1000000007LL
#define len(x)              (int) x.size()
#define all(x)              x.begin(), x.end()
#define rall(x)             x.rbegin(), x.rend()
#define mem(x, y)           memset(x, y, sizeof x)
#define FOR(x, l, r)        for (int x = l; x <= r; ++x)
#define ROF(x, l, r)        for (int x = l; x >= r; --x)

template <TN T> inline void Int(T &n) {
    n = 0; int f = 1; register int ch = getchar();
    for (; !isdigit(ch); ch = getchar()) if (ch == '-') f = -1;
    for (; isdigit(ch); ch = getchar()) n = (n << 3) + (n << 1) + ch - '0';
    n = n * f;
}

template <TN T> T gcd(T a, T b) {return !b ? a : gcd(b, a % b);}
template <TN T> inline void umin(T &a, T b) {a = a < b ? a : b;}
template <TN T> inline void umax(T &a, T b) {a = a > b ? a : b;}
template <TN T, TN W> inline void Int(T &x, W &y) {Int(x), Int(y);}
template <TN T, TN W, TN Q> void Int(T &x, W &y, Q &z) {Int(x, y), Int(z);}

const int N = 1e5 + 7;
const int inf = 1e9 + 7;

char s[N];

int solve() {
    scanf("%s", s + 1);
    int n = strlen(s + 1);

    FOR (row, 1, 5) {
        int col = n / row + (n % row > 0);
        if (col > 20) continue;
        int k = 1;
        printf("%d %d\n", row, col);
        FOR (i, 1, row) {
            FOR (j, 1, col) {
                if (k <= n) {
                    printf("%c", s[k]);
                    ++k;
                } else {
                    printf("*");
                }
            }
            printf("\n");
        }
        break;
    }

    return 0;
}

int main() {
    int tests = 1, CaseNo = 0; //Int(tests);
    while (tests--) {
        //printf("Case %d: ", ++CaseNo);
        solve();
    }
    return 0;
}


/**
 *    +--+--+--++--++--In the name of ALLAH--++--++--+--+--+
 *
 *    author:  skmonir
 *    created: 18-Nov-2018 22:54:41
**/

#include <bits/stdc++.h>

using namespace std;

#define endl                '\n'
#define TN                  typename
#define mod                 1000000007LL
#define len(x)              (int) x.size()
#define all(x)              x.begin(), x.end()
#define rall(x)             x.rbegin(), x.rend()
#define mem(x, y)           memset(x, y, sizeof x)
#define FOR(x, l, r)        for (int x = l; x <= r; ++x)
#define ROF(x, l, r)        for (int x = l; x >= r; --x)

template <TN T> inline void Int(T &n) {
    n = 0; int f = 1; register int ch = getchar();
    for (; !isdigit(ch); ch = getchar()) if (ch == '-') f = -1;
    for (; isdigit(ch); ch = getchar()) n = (n << 3) + (n << 1) + ch - '0';
    n = n * f;
}

template <TN T> T gcd(T a, T b) {return !b ? a : gcd(b, a % b);}
template <TN T> inline void umin(T &a, T b) {a = a < b ? a : b;}
template <TN T> inline void umax(T &a, T b) {a = a > b ? a : b;}
template <TN T, TN W> inline void Int(T &x, W &y) {Int(x), Int(y);}
template <TN T, TN W, TN Q> void Int(T &x, W &y, Q &z) {Int(x, y), Int(z);}

const int N = 1e5 + 7;
const int inf = 1e9 + 7;

char s[N];

int solve() {
    scanf("%s", s + 1);
    int n = strlen(s + 1);

    FOR (row, 1, 5) if (row * 20 >= n) {
        FOR (col, 1, 20) if (row * col >= n) {
            int col = n / row + (n % row > 0);
            int k = 1, star = row * col - n;
            int lf = (star + 1) / 2, rg = star - lf;
            printf("%d %d\n", row, col);
            FOR (i, 1, row) {
                FOR (j, 1, col) {
                    if (lf and i == 1) {
                        printf("*"); --lf;
                        continue;
                    }
                    if (rg and i == 2) {
                        printf("*"); --rg;
                        continue;
                    }
                    printf("%c", s[k]);
                    ++k;
                }
                printf("\n");
            }
            return 0;
        }
    }

    return 0;
}

int main() {
    int tests = 1, CaseNo = 0; //Int(tests);
    while (tests--) {
        //printf("Case %d: ", ++CaseNo);
        solve();
    }
    return 0;
}


/**
 *    +--+--+--++--++--In the name of ALLAH--++--++--+--+--+
 *
 *    author:  skmonir
 *    created: 18-Nov-2018 22:54:41
**/

#include <bits/stdc++.h>

using namespace std;

#define endl                '\n'
#define TN                  typename
#define mod                 1000000007LL
#define len(x)              (int) x.size()
#define all(x)              x.begin(), x.end()
#define rall(x)             x.rbegin(), x.rend()
#define mem(x, y)           memset(x, y, sizeof x)
#define FOR(x, l, r)        for (int x = l; x <= r; ++x)
#define ROF(x, l, r)        for (int x = l; x >= r; --x)

template <TN T> inline void Int(T &n) {
    n = 0; int f = 1; register int ch = getchar();
    for (; !isdigit(ch); ch = getchar()) if (ch == '-') f = -1;
    for (; isdigit(ch); ch = getchar()) n = (n << 3) + (n << 1) + ch - '0';
    n = n * f;
}

template <TN T> T gcd(T a, T b) {return !b ? a : gcd(b, a % b);}
template <TN T> inline void umin(T &a, T b) {a = a < b ? a : b;}
template <TN T> inline void umax(T &a, T b) {a = a > b ? a : b;}
template <TN T, TN W> inline void Int(T &x, W &y) {Int(x), Int(y);}
template <TN T, TN W, TN Q> void Int(T &x, W &y, Q &z) {Int(x, y), Int(z);}

const int N = 1e5 + 7;
const int inf = 1e9 + 7;

char s[N];

int solve() {
    scanf("%s", s + 1);
    int n = strlen(s + 1);

    FOR (row, 1, 5) {
        int col = n / row + (n % row > 0);
        if (col > 20) continue;
        int k = 1, star = row * col - n;
        int lf = (star + 1) / 2, rg = star - lf;
        printf("%d %d\n", row, col);
        FOR (i, 1, row) {
            FOR (j, 1, col) {
                if (lf and i == 1) {
                    printf("*"); --lf;
                    continue;
                }
                if (rg and i == 2) {
                    printf("*"); --rg;
                    continue;
                }
                printf("%c", s[k]);
                ++k;
            }
            printf("\n");
        }
        break;
    }

    return 0;
}

int main() {
    int tests = 1, CaseNo = 0; //Int(tests);
    while (tests--) {
        //printf("Case %d: ", ++CaseNo);
        solve();
    }
    return 0;
}


/**
 *    +--+--+--++--++--In the name of ALLAH--++--++--+--+--+
 *
 *    author:  skmonir
 *    created: 18-Nov-2018 22:54:41
**/

#include <bits/stdc++.h>

using namespace std;

#define endl                '\n'
#define TN                  typename
#define mod                 1000000007LL
#define len(x)              (int) x.size()
#define all(x)              x.begin(), x.end()
#define rall(x)             x.rbegin(), x.rend()
#define mem(x, y)           memset(x, y, sizeof x)
#define FOR(x, l, r)        for (int x = l; x <= r; ++x)
#define ROF(x, l, r)        for (int x = l; x >= r; --x)

template <TN T> inline void Int(T &n) {
    n = 0; int f = 1; register int ch = getchar();
    for (; !isdigit(ch); ch = getchar()) if (ch == '-') f = -1;
    for (; isdigit(ch); ch = getchar()) n = (n << 3) + (n << 1) + ch - '0';
    n = n * f;
}

template <TN T> T gcd(T a, T b) {return !b ? a : gcd(b, a % b);}
template <TN T> inline void umin(T &a, T b) {a = a < b ? a : b;}
template <TN T> inline void umax(T &a, T b) {a = a > b ? a : b;}
template <TN T, TN W> inline void Int(T &x, W &y) {Int(x), Int(y);}
template <TN T, TN W, TN Q> void Int(T &x, W &y, Q &z) {Int(x, y), Int(z);}

const int N = 1e5 + 7;
const int inf = 1e9 + 7;

char s[N];

int solve() {
    scanf("%s", s + 1);
    int n = strlen(s + 1);

    FOR (row, 1, 5) if (row * 20 >= n) {
        FOR (col, 1, 20) if (row * col >= n) {
            int col = n / row + (n % row > 0);
            int k = 1, star = row * col - n;
            vector <int> to_give(6, 0);
            int per = star / row, extra = star % row;
            FOR (k, 1, row) to_give[k] += per;
            FOR (k, 1, row) {
                if (extra == 0) break;
                ++to_give[k], --extra;
            }
            printf("%d %d\n", row, col);
            FOR (i, 1, row) {
                FOR (j, 1, col) {
                    if (to_give[i]) {
                        printf("*"); --to_give[i];
                        continue;
                    }
                    printf("%c", s[k]);
                    ++k;
                }
                printf("\n");
            }
            return 0;
        }
    }

    return 0;
}

int main() {
    int tests = 1, CaseNo = 0; //Int(tests);
    while (tests--) {
        //printf("Case %d: ", ++CaseNo);
        solve();
    }
    return 0;
}


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

const int D[] = {0,1,3,6,10,15};

int main(){
    // freopen("b.inp","r",stdin);
    string S;
    cin>>S;
    int cnt,dCnt,k,rownum;
    int n = S.length();
    for(int i=1;i<=5;++i){
        if (n%i<=D[i] && n/i+(n%i!=0)<=20) {rownum=i; break;}
    }
    int rowlength = n/rownum+(n%rownum!=0);
    dCnt = n%rownum==0?0:rownum - n%rownum;
    while(dCnt--){S.insert(k,"*");k+=rowlength;k%=S.length();}

    cnt=0;
    cout<<rownum<<" "<<rowlength<<"\n";
    for(int i=1;i<=5;++i){
        for(int j=1;j<=rowlength;++j){
            cout<<S[cnt++];
        }
        cout<<"\n";
    }
    return 0;
}


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

const int D[] = {0,1,3,6,10,15};

int main(){
    // freopen("b.inp","r",stdin);
    string S;
    cin>>S;
    int cnt,dCnt,k,rownum;
    int n = S.length();
    for(int i=1;i<=5;++i){
        if (n%i<=D[i] && n/i+(n%i!=0)<=20) {rownum=i; break;}
    }
    int rowlength = n/rownum+(n%rownum!=0);
    dCnt = rownum - n%rownum;
    while(dCnt--){S.insert(k,"*");k+=rowlength;k%=S.length();}

    cnt=0;
    cout<<rownum<<" "<<rowlength<<"\n";
    for(int i=1;i<=5;++i){
        for(int j=1;j<=rowlength;++j){
            cout<<S[cnt++];
        }
        cout<<"\n";
    }
    return 0;
}


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

int main(){
    // freopen("b.inp","r",stdin);
    string S;
    cin>>S;
    int cnt,dCnt,k;
    int rowlength = S.length()/5+(S.length()%5!=0);
    dCnt = 5 - S.length()%5;k=0;
    while(dCnt--){S.insert(k,"*");k+=rowlength;}

    cnt=0;
    cout<<"5 "<<rowlength<<"\n";
    for(int i=1;i<=5;++i){
        for(int j=1;j<=rowlength;++j){
            cout<<S[cnt++];
        }
        cout<<"\n";
    }
    return 0;
}


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

const int D[] = {0,1,3,6,10,15};

int main(){
    // freopen("b.inp","r",stdin);
    string S;
    cin>>S;
    int cnt,dCnt,k,rownum;
    int n = S.length();
    cerr<<n<<"\n";
    for(int i=1;i<=5;++i){
        if (n%i<=D[i] && n/i+(n%i!=0)<=20) {rownum=i; break;}
    }
    int rowlength = n/rownum+(n%rownum!=0);
    dCnt = n%rownum==0?0:rownum - n%rownum;
    k=0;while(dCnt--){S.insert(k,"*");k+=rowlength;k%=S.length();}

    cnt=0;
    cout<<rownum<<" "<<rowlength<<"\n";
    for(int i=1;i<=rownum;++i){
        for(int j=1;j<=rowlength;++j){
            cout<<S[cnt++];
        }
        cout<<"\n";
    }
    return 0;
}


#include<bits/stdc++.h>
typedef long long int ll;
typedef long double ld;
#define pii pair <ll,ll>
#define pb push_back
#define vi vector<ll>
#define vii vector<pii>
#define mp make_pair
#define F first
#define S second
#define B begin()
#define E end()
#define INF 1e18
#define MOD 1e9 + 7
#define PI 3.14159265359
using namespace std;

int main()
{
    set<int> tam;
    for(int i = 1; i <=5; i++){
        for(int j = 1; j <=20; j++){
           tam.insert(i*j);
        }
    }
    /*for(auto x: tam){
        cout<<x<<"\n";
    }*/
    string s;
    cin>>s;
    int n = s.length();
    if(n <=20){
        cout<<"1 "<<n<<"\n";
        cout<<s<<"\n";
        return 0;
    }
    if(n == 100){
        cout<<"5 20\n";
        int idx = 0;
        for(int i = 0; i < 5; i++){
            for(int j = 0; j < 20; j++){
                cout<<s[idx];
                idx++;
            }
            cout<<"\n";
        }
        return 0;
    }
    int i =2;
    //cout<<"n:"<<n<<"\n";
    int c= n/i;
    while(c >20){
        i++;
        c= n/i;
    }

    if(c+1<=20){
        int res = abs(n-(i*c));
        int res2 = abs(n-(i*(c+1)));
        int row,col,num;
        if(res < res2){
            row = i;
            col = c;
            num = res;
        }
        else{
            row = i;
            col = c+1;
            num = res2;
        }
        int idx = 0;
        cout<<row<<" "<<col<<"\n";
        for(int i = 0; i < row; i++){
            bool sw = true;
            for(int j = 0; j < col; j++){
                if(num>0 && sw){
                    cout<<"*";
                    sw = false;
                    num--;
                }
                else{
                    cout<<s[idx];
                    idx++;
                }
            }
            cout<<"\n";
        }
    }

    return 0;
}


#include<bits/stdc++.h>
typedef long long int ll;
typedef long double ld;
#define pii pair <ll,ll>
#define pb push_back
#define vi vector<ll>
#define vii vector<pii>
#define mp make_pair
#define F first
#define S second
#define B begin()
#define E end()
#define INF 1e18
#define MOD 1e9 + 7
#define PI 3.14159265359
using namespace std;

int main()
{
    set<int> tam;
    for(int i = 1; i <=5; i++){
        for(int j = 1; j <=20; j++){
           tam.insert(i*j);
        }
    }
    /*for(auto x: tam){
        cout<<x<<"\n";
    }*/
    string s;
    cin>>s;
    int n = s.length();
    if(n <=20){
        cout<<"1 "<<n<<"\n";
        cout<<s<<"\n";
        return 0;
    }
    int i =2;
    //cout<<"n:"<<n<<"\n";
    int c= n/i;
    while(c >20){
        i++;
        c= n/i;
    }

    if(c+1<=20){
        int res = abs(n-(i*c));
        int res2 = abs(n-(i*(c+1)));
        int row,col,num;
        if(res < res2){
            row = i;
            col = c;
            num = res;
        }
        else{
            row = i;
            col = c+1;
            num = res2;
        }
        int idx = 0;
        cout<<row<<" "<<col<<"\n";
        for(int i = 0; i < row; i++){
            bool sw = true;
            for(int j = 0; j < col; j++){
                if(num>0 && sw){
                    cout<<"*";
                    sw = false;
                    num--;
                }
                else{
                    cout<<s[idx];
                    idx++;
                }
            }
            cout<<"\n";
        }
    }

    return 0;
}


#include<bits/stdc++.h>
typedef long long int ll;
typedef long double ld;
#define pii pair <ll,ll>
#define pb push_back
#define vi vector<ll>
#define vii vector<pii>
#define mp make_pair
#define F first
#define S second
#define B begin()
#define E end()
#define INF 1e18
#define MOD 1e9 + 7
#define PI 3.14159265359
using namespace std;

int main()
{
    set<int> tam;
    for(int i = 1; i <=5; i++){
        for(int j = 1; j <=20; j++){
           tam.insert(i*j);
        }
    }
    /*for(auto x: tam){
        cout<<x<<"\n";
    }*/
    string s;
    cin>>s;
    int n = s.length();
    if(n <=20){
        cout<<"1 "<<n<<"\n";
        cout<<s<<"\n";
        return 0;
    }
    if(n == 100){
        cout<<"5 20\n";
        int idx = 0;
        for(int i = 0; i < 5; i++){
            for(int j = 0; j < 20; j++){
                cout<<s[idx];
                idx++;
            }
            cout<<"\n";
        }
        return 0;
    }
    int i =2;
    //cout<<"n:"<<n<<"\n";
    int c= n/i;
    while(c >20){
        i++;
        c= n/i;
    }
    //cout<<"i:"<<i<<"\n";
    //cout<<"c:"<<c<<"\n";
    if(c+1<=20){
        int res = n-(i*c);
        int res2 = abs(n-(i*(c+1)));
        int row,col,num;
        if(res >0){
            row = i;
            col = c+1;
            num = (i*(c+1))-n;
        }
        else{
            row = i;
            col = c;
            num = abs(n-(i*(c)));
        }
        int idx = 0;
        cout<<row<<" "<<col<<"\n";
        for(int i = 0; i < row; i++){
            bool sw = true;
            for(int j = 0; j < col; j++){
                if(num>0 && sw){
                    cout<<"*";
                    sw = false;
                    num--;
                }
                else{
                    cout<<s[idx];
                    idx++;
                }
            }
            cout<<"\n";
        }
    }
    else{
        int row = i+1;
        int col = n/row;
        int idx=0;
        int num = n-(row*col);
        cout<<row<<" "<<col<<"\n";
        for(int i = 0; i < row; i++){
            bool sw = true;
            for(int j = 0; j < col; j++){
                if(num>0 && sw){
                    cout<<"*";
                    sw = false;
                    num--;
                }
                else{
                    cout<<s[idx];
                    idx++;
                }
            }
            cout<<"\n";
        }
    }

    return 0;
}


#include<bits/stdc++.h>
typedef long long int ll;
typedef long double ld;
#define pii pair <ll,ll>
#define pb push_back
#define vi vector<ll>
#define vii vector<pii>
#define mp make_pair
#define F first
#define S second
#define B begin()
#define E end()
#define INF 1e18
#define MOD 1e9 + 7
#define PI 3.14159265359
using namespace std;

int main()
{
    set<int> tam;
    for(int i = 1; i <=5; i++){
        for(int j = 1; j <=20; j++){
           tam.insert(i*j);
        }
    }
    /*for(auto x: tam){
        cout<<x<<"\n";
    }*/
    string s;
    cin>>s;
    int n = s.length();
    if(n <=20){
        cout<<"1 "<<n<<"\n";
        cout<<s<<"\n";
        return 0;
    }
    if(n == 100){
        cout<<"5 20\n";
        int idx = 0;
        for(int i = 0; i < 5; i++){
            for(int j = 0; j < 20; j++){
                cout<<s[idx];
                idx++;
            }
            cout<<"\n";
        }
        return 0;
    }
    int i =2;
    //cout<<"n:"<<n<<"\n";
    int c= n/i;
    while(c >20){
        i++;
        c= n/i;
    }
    //cout<<"i:"<<i<<"\n";
    //cout<<"c:"<<c<<"\n";
    if(c+1<=20){
        int res = n-(i*c);
        int res2 = abs(n-(i*(c+1)));
        int row,col,num;
        if(res >0){
            row = i;
            col = c+1;
            num = (i*(c+1))-n;
        }
        else{
            row = i;
            col = c;
            num = abs(n-(i*(c)));
        }
        int idx = 0;
        cout<<row<<" "<<col<<"\n";
        for(int i = 0; i < row; i++){
            bool sw = true;
            for(int j = 0; j < col; j++){
                if(num>0 && sw){
                    cout<<"*";
                    sw = false;
                    num--;
                }
                else{
                    cout<<s[idx];
                    idx++;
                }
            }
            cout<<"\n";
        }
    }
    else if(n == i*c){
        int row = i;
        int col = c;
        int idx=0;
        int num = 0;
        cout<<row<<" "<<col<<"\n";
        for(int i = 0; i < row; i++){
            bool sw = true;
            for(int j = 0; j < col; j++){
                if(num>0 && sw){
                    cout<<"*";
                    sw = false;
                    num--;
                }
                else{
                    cout<<s[idx];
                    idx++;
                }
            }
            cout<<"\n";
        }

    }
    else{
        int row = i+1;
        int col = n/row;
        int idx=0;
        int num = n-(row*col);
        cout<<row<<" "<<col<<"\n";
        for(int i = 0; i < row; i++){
            bool sw = true;
            for(int j = 0; j < col; j++){
                if(num>0 && sw){
                    cout<<"*";
                    sw = false;
                    num--;
                }
                else{
                    cout<<s[idx];
                    idx++;
                }
            }
            cout<<"\n";
        }
    }

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
int n,a[101010];
main () {
	cin >>n;
	for (int i = 1; i <= n; i++)
	{
		a[i] = i;
	}
	int l,r;
	for (int i = 1; i <= n; i++)
	{
		cin >>l >>r;
		int raz = r - l + 1;
		if (l % 2 == 0)
		{
			if (raz % 2 == 0)
			{
				cout <<-(raz/2) <<endl;
			}
			else
				cout <<-(raz/2) + r <<endl;
			continue;
		}
		if (l % 2 == 1)
		{
			if (raz % 2 == 0)
			{
				cout <<raz/2 <<endl;
			}
			else
				cout <<raz/2-r <<endl;
		}
	}
}


#include <bits/stdc++.h>
using namespace std;
long long n,l,r;
main () {
	cin >>n;
	for (int i = 1; i <= n; i++)
	{
		cin >>l >>r;
		long long ans = 0;
		if (r - l == 0 && l % 2 == 0) cout <<l<<endl;
		else
		if (r - l == 0 && l % 2 == 1) cout <<-l <<endl;
		else
		if (r - l == 1) cout <<l - r <<endl;
		else
		if ((r - l) % 2 == 1) cout <<l - r + 1<<endl;
		else
		if ((r - l % 2 == 1) % 2 == 0) cout <<l - r <<endl;
	}
}


#include <bits/stdc++.h>
using namespace std;
long long n,l,r;
main () {
	cin >>n;
	for (int i = 1; i <= n; i++)
	{
		cin >>l >>r;
		long long ans, otv = 0;
		ans = abs(r - l);
		if (((r - l) % 2 == 0 && l - r != 0) || r - l == 1) cout <<l - r <<endl;
		else
		if (l == r && l % 2 == 0) cout <<l <<endl;
		else
		if (l == r && l % 2 == 1) cout <<-l <<endl;
		else
		cout <<l - r + 1 <<endl;
	}
}


#include <bits/stdc++.h>
using namespace std;
long long n,l,r;
main () {
	cin >>n;
	for (int i = 1; i <= n; i++)
	{
		cin >>l >>r;
		long long ans = 0;
		for (int i = l; i <= r; i++)
		{
			if (i % 2 == 1) ans-=i;
			else
			ans+=i;
		}
		cout <<ans <<endl;
	}
}


#include <bits/stdc++.h>
using namespace std;
long long n,l,r;
main () {
	cin >>n;
	for (int i = 1; i <= n; i++)
	{
		cin >>l >>r;
		long long ans = 0;
		for (int i = l; i <= r; i++)
			ans+=i * pow(-1,i);
		cout <<ans <<endl;
	}
}


#include <bits/stdc++.h>

using namespace std;
long long a[1000001],n,t,t1=0,m;

int main()
{
    //freopen("b1.inp","r",stdin);
    //freopen("b1.out","w",stdout);
    cin>>t;
    for(long long i=1;i<=t;i++)
    {
        t1=0;
        cin>>n>>m;
        for(long long i=n;i<=m;i++)
        {
            if(i%2==0)t1+=i;
            else t1-=i;
            //cout<<t1<<" ";
        }
        cout<<t1<<endl;
    }

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);
#define pb push_back
#define vbe v.begin(),v.end()
#define mx *max_element
#define mi *min_element
#define itep vector < pair < long long , long long > > :: iterator it;
#define ite vector < long long > :: iterator it;
#define fn for(ll i =0 ;i <n;i++)
#define fn1 for( ll i =1;i<=n;i++)
#define fi first
#define se second
int main(){
    fast;
    ll q;
    cin>>q;
    while(q--){
        ll a, b;
        cin>>a>>b;
        if(a==b){
            if(a%2==0){
                cout<<a<<endl;
                continue ;
            }
            else
            {
                cout<<-1*(a)<<endl;
                continue;
            }
        }
        else if(a%2==0 && b%2==0){
            ll n = b/2- a/2+1;
            ll s1= (n)*((a+b)/2);
            a= a+1;
            b=b-1;
            ll n1 = b/2- a/2+1;
            ll s2= (n1)*((a+b)/2);
            cout<<s1-s2<<endl;
        }
        else if(a%2!=0 && b%2!=0){
            ll n = b/2- a/2+1;
            ll s2= (n)*((a+b)/2);
            a=a+1;
            b=b-1;
            ll n1 = b/2- a/2+1;
            ll s1= (n1)*((a+b)/2);
            cout<<s1-s2<<endl;
        }
        else if(a%2==0 && b%2!=0){
            ll y  = b-1;
            ll n = y/2- a/2+1;
            ll s1= (n)*((a+y)/2);
            ll x= a+1;
            ll n1 = b/2- x/2+1;
            ll s2= (n1)*((x+b)/2);
            cout<<s1-s2<<endl;
        }
        else {
            ll x=a+1;
            ll n  = b/2-x/2+1;
            ll s1= (n)*((x+b)/2);
            ll y = b-1;
            ll n1 = y/2-a/2+1;
            ll s2= (n1)*((a+y)/2);
            cout<<s1-s2<<endl;
        }
    }
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);
#define pb push_back
#define vbe v.begin(),v.end()
#define itep vector < pair < long long , long long > > :: iterator it;
#define ite vector < long long > :: iterator it;
#define fn for(ll i =0 ;i <n;i++)
#define fn1 for( ll i =1;i<=n;i++)
#define fi first
#define se second
int main(){
    fast;
    ll q;
    cin>>q;
    while(q--){
        ll a, b;
        cin>>a>>b;
        if(a==b){
            if(a%2==0){
                cout<<a<<endl;
                continue ;
            }
            else
            {
                cout<<-1*(a)<<endl;
                continue;
            }
        }
        else if(a%2==0 && b%2==0){
            ll n = b/2- a/2+1;
            ll s1= (n)*((a+b)/2);
            a= a+1;
            b=b-1;
            ll n1 = b/2- a/2+1;
            ll s2= (n1)*((a+b)/2);
            cout<<s1-s2<<endl;
        }
        else if(a%2!=0 && b%2!=0){
            ll n = b/2- a/2+1;
            ll s2= (n)*((a+b)/2);
            a=a+1;
            b=b-1;
            ll n1 = b/2- a/2+1;
            ll s1= (n1)*((a+b)/2);
            cout<<s1-s2<<endl;
        }
        else if(a%2==0 && b%2!=0){
            ll y  = b-1;
            ll n = y/2- a/2+1;
            ll s1= (n)*((a+y)/2);
            ll x= a+1;
            ll n1 = b/2- x/2+1;
            ll s2= (n1)*((x+b)/2);
            cout<<s1-s2<<endl;
        }
        else {
            ll x=a+1;
            ll n  = b/2-x/2+1;
            ll s1= (n)*((x+b)/2);
            ll y = b-1;
            ll n1 = y/2-a/2+1;
            ll s2= (n1)*((a+y)/2);
            cout<<s1-s2<<endl;
        }
    }
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);
#define pb push_back
#define vbe v.begin(),v.end()
#define mx *max_element
#define mi *min_element
#define itep vector < pair < long long , long long > > :: iterator it;
#define ite vector < long long > :: iterator it;
#define fn for(long long int i =0 ;i <n;i++)
#define fn1 for(long long int i =1;i<=n;i++)
#define fi first
#define se second
int main(){
    fast;
    ll t;
    cin>>t;
    while(t--){
        ll n , m ;
        cin>>n>>m;
        if(n==m){
            if(n%2==0){
                cout<<n<<endl;
                continue;
            }
            else
            {
                cout<<-1*n<<endl;
                continue;
            }
            continue;
        }
        if(n%2==0 && m%2==0 || n%2==1 && m%2==1 )cout<< abs(n-m)/2 + n <<endl;
        else{
            if(n%2!=0 && m%2==0){
                n--;
                cout<<abs(n-m)/2<<endl;
            }
            else{
                n--;
                cout<<-1*(abs(n-m)/2)<<endl;
            }
        }
    }
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);
#define pb push_back
#define vbe v.begin(),v.end()
#define mx *max_element
#define mi *min_element
#define itep vector < pair < long long , long long > > :: iterator it;
#define ite vector < long long > :: iterator it;
#define fn for(long long int i =0 ;i <n;i++)
#define fn1 for(long long int i =1;i<=n;i++)
#define fi first
#define se second
int main(){
    fast;
    ll t;
    cin>>t;
    while(t--){
        ll n , m ;
        cin>>n>>m;
        if(n==m){
            if(n%2==0){
                cout<<n<<endl;
                continue;
            }
            else
            {
                cout<<-1*n<<endl;
                continue;
            }
            continue;
        }
        if(n%2==0 && m%2==0)cout<< abs(n-m)/2 + n <<endl;
        if( n%2==1 && m%2==1 )cout<<-1*(abs(n-m)/2 + n) <<endl;
        else{
            if(n%2!=0 && m%2==0){
                n--;
                cout<<abs(n-m)/2<<endl;
            }
            else{
                n--;
                cout<<-1*(abs(n-m)/2)<<endl;
            }
        }
    }
}


#include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
//int a[10010],b[10010];
int main(){
	long long i,j,k,n,temp,sum,a,b;
	cin>>n;
/*	for(i=1;i<=n;i++){
		cin>>a[i]>>b[i];
	}*/
	for(i=1;i<=n;i++){
		cin>>a>>b;
		sum=0;
		for(j=a;j<=b;j++){
			if(j%2==1)
				k=-1;
			else
				k=1;
			temp=j*k;
			sum=sum+temp;
		}
		cout<<sum<<endl;
	}
	return 0;
}


#include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
int main(){
	long long i,j,k,n,temp,sum,a,b,aa;
	cin>>n;
	for(i=1;i<=n;i++){
		cin>>a>>b;
		sum=0;
		//如果第一个数是奇数
		if(a%2==1){
			//如果结尾的数是奇数
			if(b%2==1){
				sum=(b-a)/2-b;
			}
			else{
				sum=(b-a+1)/2;
			}
		}
		//如果第一个数是偶数
		else{
			if(b%2==0){
				sum=(-1)*(b-a)/2+b;
			}
			else{
				sum=((b+1-a)/2)*(-1);
			}
		}
		cout<<sum<<endl;
		}
	return 0;
}


#include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
//int a[10010],b[10010];
int main(){
	long long i,j,k,n,temp,sum,a,b;
	cin>>n;
/*	for(i=1;i<=n;i++){
		cin>>a[i]>>b[i];
	}*/
	for(i=1;i<=n;i++){
		cin>>a>>b;
		sum=0;
		for(j=;j<=b;j++){
			if(j%2==1)
				k=-1;
			else
				k=1;
			temp=j*k;
			sum=sum+temp;
		}
		cout<<sum<<endl;
	}
	return 0;
}


#include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
int a[10010],b[10010];
int main(){
	long long i,j,k,n,temp,sum;
	cin>>n;
	for(i=1;i<=n;i++){
		cin>>a[i]>>b[i];
	}
	for(i=1;i<=n;i++){
	//	cin>>a>>b;
		sum=0;
		for(j=a[i];j<=b[i];j++){
			if(j%2==1)
				k=-1;
			else
				k=1;
			temp=j*k;
			sum=sum+temp;
		}
		cout<<sum<<endl;
	}
	return 0;
}


#include<iostream>
#include<cstring>
#include<cstdio>
#include<algorithm>
#include<vector>
#include<set>
#include<map>
#include<queue>
#include<cmath>
#define ll long long
#define mod 1000000007
#define inf 0x3f3f3f3f
using namespace std;

int main()
{
    ll l, r;
    int t;
    scanf("%d",&t);
    while(t --)
    {
        cin>>l>>r;
        if(l%2 && r%2)//jj
        {
            cout<<(r-l)/2-r<<endl;
        }
        else if(l%2 && r%2==0)//jo
        {
            cout<<(r-l+1)/2<<endl;
        }
        else if(l%2==0 && r%2==0)//oo
        {
            cout<<(1+l-r)/2+r<<endl;
        }
        else cout<<(l-r-1)/2<<endl;//jp
    }
    return 0;
}


#include<iostream>
#include<cstring>
#include<cstdio>
#include<algorithm>
#include<vector>
#include<set>
#include<map>
#include<queue>
#include<cmath>
#define ll long long
#define mod 1000000007
#define inf 0x3f3f3f3f
using namespace std;

int main()
{
    ll l, r;
    int t;
    scanf("%d",&t);
    while(t --)
    {
        cin>>l>>r;
        if(l%2 && r%2)//jj
        {
            cout<<(r-l)/2-r<<endl;
        }
        else if(l%2 && r%2==0)//jo
        {
            cout<<(r-l+1)/2<<endl;
        }
        else if(l%2==0 && r%2==0)//oo
        {
            cout<<(l-r)/2+r<<endl;
        }
        else cout<<(l-r-1)/2<<endl;//jp
    }
    return 0;
}


#include<iostream>
#include<cstring>
#include<cstdio>
#include<algorithm>
#include<vector>
#include<set>
#include<map>
#include<queue>
#include<cmath>
#define ll long long
#define mod 1000000007
#define inf 0x3f3f3f3f
using namespace std;

int main()
{
    int l, r;
    int t;
    scanf("%d",&t);
    while(t --)
    {
        scanf("%d%d",&l,&r);
        if(l%2 && r%2)
        {
            printf("%d\n",(r-l+1)/2-r);
        }
        else if(l%2 && r%2==0)
        {
            printf("%d\n",(r-l+1)/2);
        }
        else if(l%2==0 && r%2==0)
        {
            printf("%d\n",(1+l-r)/2+r);
        }
        else printf("%d\n",(l-r-1)/2);
    }
    return 0;
}


#include<iostream>
#include<cstring>
#include<cstdio>
#include<algorithm>
#include<vector>
#include<set>
#include<map>
#include<queue>
#include<cmath>
#define ll long long
#define mod 1000000007
#define inf 0x3f3f3f3f
using namespace std;

int main()
{
    ll l, r;
    int t;
    scanf("%d",&t);
    while(t --)
    {
        cin>>l>>r;
        if(l%2 && r%2)
        {
            cout<<(r-l+1)/2-r<<endl;
        }
        else if(l%2 && r%2==0)
        {
            cout<<(r-l+1)/2<<endl;
        }
        else if(l%2==0 && r%2==0)
        {
            cout<<(1+l-r)/2+r<<endl;
        }
        else cout<<(l-r-1)/2<<endl;
    }
    return 0;
}


#include<iostream>
#include<cstdio>
int l,r,q;//头文件
int main()
{

    scanf("%d",&q);
    for(int i=1;i<=q;i++)
    {
        int ans=0;
        scanf("%d%d",&l,&r);
        l--;
        if(l%2==0) l/=2;
        else l=-(l+1)/2;
        if(r%2==0) r/=2;
        else r=-(r+1)/2;
        printf("%d\n",r-l);
    }
    return 0;
 }


#include<bits/stdc++.h>
using namespace std;
int main()
{
	int q;
	int x;
	int l,r,s=0;
	scanf("%d",&q);
	for(int i=1;i<=q;i++)
		{
			scanf("%d %d",&l,&r);
			for(int j=l;j<=r;j++)
				{
					if(j%2==0)
						{
							x=1;
							s=s+x*j;
						}
						else
						{
							x=-1;
							s=s+x*j;
						}
				}
				printf("%d\n",s);
				s=0;
		}
			return 0;
}


#include<bits/stdc++.h>
#define For(i, j, k) for(int i = (j); i <= (k); i++)

using namespace std;
inline int getsum(int x) {
	if(x & 1) {
		return  - (x / 2 + 1);
	} else {
		return x / 2;
	}
}
int main()
{
	int _;
	cin >> _;
	while(_--) {
		int l, r;
		scanf("%d %d", &l, &r);
		cout << getsum(r) - getsum(l-1) << endl;
	}

	return 0;
}


#include<iostream>
#include<cstdio>
int l,r,q;
int main()
{

    scanf("%d",&q);
    for(int i=1;i<=q;i++)
    {
        int ans=0;
        scanf("%d%d",&l,&r);
        l--;
        if(l%2==0) l/=2;
        else l=-(l+1)/2;
        if(r%2==0) r/=2;
        else r=-(r+1)/2;
        printf("%d\n",r-l);
    }
    return 0;
 }


#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<cstdlib>
using namespace std;
int q;
int main(){
	int l,r;
	scanf("%d",&q);
	for(int i=1;i<=q;++i){
		scanf("%d%d",&l,&r);
		if(l==r){
			if(l%2==1) printf("-%d\n",l);
			else printf("%d\n",l);
			continue;
		}
		if(l%2==0&&r%2==1) printf("-%d\n",(r-1)/2);
		if(l%2==1&&r%2==1) printf("%d\n",(r-1)/2-r);
		if(l%2==1&&r%2==0) printf("%d\n",r/2);
		if(l%2==0&&r%2==0) printf("%d\n",r-(r-2)/2);
	}
	return 0;
}


#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>

inline int read()
{
	int res = 0; bool bo = 0; char c;
	while (((c = getchar()) < '0' || c > '9') && c != '-');
	if (c == '-') bo = 1; else res = c - 48;
	while ((c = getchar()) >= '0' && c <= '9')
		res = (res << 3) + (res << 1) + (c - 48);
	return bo ? ~res + 1 : res;
}

int q;

int main()
{
	int l, r;
	q = read();
	while (q--)
	{
		l = read(); r = read();
		int res = l & 1 ? r - l + 1 >> 1 : - (r - l + 1 >> 1);
		if (!(r - l & 1))
		{
			if (r & 1) res -= r;
			else res += r;
		}
		printf("%d\n", res);
	}
	return 0;
}


#include <bits/stdc++.h>
#define ll long long
using namespace std;
ll q,l,r,ans;

inline ll read(){
    register ll x=0,f=1;char ch=getchar();
    while(!isdigit(ch)){if(ch=='-')f=-1;ch=getchar();}
    while(isdigit(ch)){x=(x<<3)+(x<<1)+ch-'0';ch=getchar();}
    return (f==1)?x:-x;
}

int main()
{
    q=read();
    while(q--){
        l=read(),r=read();
        ans=0;
        if(l%2==0) l--,ans+=l;
        if(r%2==1) r++,ans-=r;
        ans+=(r-l+1)/2;
        printf("%I64d\n",ans);
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main(){
    int l,r,q;
    cin>>q;
    for(int i=1;i<=q;i++){
        cin>>l>>r;
        l--;
        if(l%2==0) l/=2;
        else l=-(l+1)/2;
        if(r%2==0) r/=2;
        else r=-(r+1)/2;
        cout<<r-l<<endl;
    }
    return 0;
 }


#include <bits/stdc++.h>

typedef long long ll;

int main(int argc, char const **argv)
{
    std::ios::sync_with_stdio(false);
    std::cin.tie(0);
    int T, l, r;
    for(std::cin >> T; T--; ){
        std::cin >> l >> r;
        // regard as 2 arithmetic progression
        // regard as all to positive number
        ll sum1 = (l+r)*(r-l+1)/2;
        ll sum2;
        if(l%2 == 0 && r%2 == 0){
            sum2 = (l+1+r-1)*( (r-1-(l+1))/2 + 1)/2;
        }else if(l%2 == 0 && r%2 != 0){
            sum2 = (l+1+r)*( (r-(l+1))/2 + 1)/2;
        }else if(l%2 != 0 && r%2 == 0){
            sum2 = (l+r-1)*( (r-1-l)/2 + 1)/2;
        }else {
            sum2 = (l+r)*( (r-l)/2 + 1)/2;
        }
        std::cout << sum1 - 2*sum2 << std::endl;
    }
    return 0;
}


#include <bits/stdc++.h>

typedef long long ll;

int main(int argc, char const **argv)
{
    std::ios::sync_with_stdio(false);
    std::cin.tie(0);
    ll T, l, r;
    for(std::cin >> T; T--; ){
        std::cin >> l >> r;
        // regard as 2 arithmetic progression
        // regard as all to positive number
        ll sum1 = (l+r)*(r-l+1)/2;
        ll sum2;
        if(l%2 == 0 && r%2 == 0){
            sum2 = (l+1+r-1)*( (r-1-(l+1))/2 + 1)/2;
        }else if(l%2 == 0 && r%2 != 0){
            sum2 = (l+1+r)*( (r-(l+1))/2 + 1)/2;
        }else if(l%2 != 0 && r%2 == 0){
            sum2 = (l+r-1)*( (r-1-l)/2 + 1)/2;
        }else {
            sum2 = (l+r)*( (r-l)/2 + 1)/2;
        }
        std::cout << sum1 - 2*sum2 << std::endl;
    }
    return 0;
}


#include <bits/stdc++.h>

typedef long long ll;

#if 0
int main(int argc, char const **argv)
{
    std::ios::sync_with_stdio(false);
    std::cin.tie(0);
    ll T, l, r;
    for(std::cin >> T; T--; ){
        std::cin >> l >> r;
        // regard as 2 arithmetic progression, regard as all to positive number
        ll sumAll = (l+r)*(r-l+1)/2;
        ll sumNegative;
        if( (l&1) && (r&1) )
            sumNegative = (l+r)*( (r-l)/2 + 1)/2;
        else if( (l&1)==0 && (r&1) )
            sumNegative = (l+1+r)*( (r-(l+1))/2 + 1)/2;
        else if( (l&1) &&  (r&1)==0 )
            sumNegative = (l+r-1)*( (r-1-l)/2 + 1)/2;
        else
            sumNegative = (l+1+r-1)*( (r-1-(l+1))/2 + 1)/2;

        std::cout << sumAll - 2*sumNegative << std::endl;
    }
    return 0;
}
#endif

int main(int argc, char const **argv)
{
    std::ios::sync_with_stdio(false);
    std::cin.tie(0);
    ll T, l, r;
    for(std::cin >> T; T--; ){
        std::cin >> l >> r;
        ll sum, num = r - l + 1; // numbers
        if(num & 1)  // odd
            sum = num == 1 ? ( l&1 ? -l : l) : ( l&1 ? -l-num/2 : l+num/2);
        else  // even
            sum = l&1 ? num/2 : -num/2;
        std::cout << sum << std::endl;
    }
    return 0;
}


#include <bits/stdc++.h>

typedef long long ll;

int main(int argc, char const **argv)
{
    std::ios::sync_with_stdio(false);
    std::cin.tie(0);
    ll T, l, r;
    for(std::cin >> T; T--; ){
        std::cin >> l >> r;
        // regard as 2 arithmetic progression, regard as all to positive number
        ll sumAll = (l+r)*(r-l+1)/2;
        ll sumNegative;
        if( (l&1) && (r&1) )
            sumNegative = (l+r)*( (r-l)/2 + 1)/2;
        else if( (l&1)==0 && (r&1) )
            sumNegative = (l+1+r)*( (r-(l+1))/2 + 1)/2;
        else if( (l&1) &&  (r&1)==0 )
            sumNegative = (l+r-1)*( (r-1-l)/2 + 1)/2;
        else
            sumNegative = (l+1+r-1)*( (r-1-(l+1))/2 + 1)/2;

        std::cout << sumAll - 2*sumNegative << std::endl;
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
int arr[1000];
int main () {
	int n, l, r;
	cin >> n;
	for (int i=1; i<=n; i++) {
		cin >> l >> r;
		int sum=0;
		for (int j=l; j<=r; j++) {
			sum+=(j*pow(-1, j));
		}
		arr[i]=sum;
	}
	for (int i=1; i<=n; i++) {
		cout << arr[i] << "\n";
	}
}


#include <bits/stdc++.h>
using namespace std;
int arr[10000];
int f(int x, int y) {
	int sum=0;
	for (int i=x; i<=y; i++) {
		sum+=i*pow(-1, i);
	}
	return sum;
}
int main () {
	int n, r, l;
	cin >> n;
	for (int i=1; i<=n; i++) {
		cin >> r >> l;
		arr[i]=f(r, l);
	}
	for (int i=1; i<=n; i++) {
		cout << arr[i] << "\n";
	}
}


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

long long F(long long x)
{
    if(x % 2 == 0)
        return x / 2;
    else
        return -x + F(x-1);
}

int main()
{
    int t;
    cin >> t;
    while(t--)
    {
        int l,r;
        cin >> l >> r;
        cout << F(r) - F(l-1) << '\n';
    }
    return 0;
}


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

#define read(x) scanf("%d",&x)

int main() {
	int T;
	read(T);
	while(T--) {
		int L,R;
		read(L),read(R);
		printf("%d\n",((R+1)/2*((R&1)?-1:1))-((L)/2*((L&1)?1:-1)));
	}

	return 0;
}


#include <iostream>
#include <cstdio>
#include <cctype>
#define il inline
#define vd void
#define int long long
#define rep(i,x,y) for(register int i=x;i<=y;++i)
#define drp(i,x,y) for(register int i=x;i>=y;--i)
using namespace std;
const int Len=2333333;
char buf[Len],*p1=buf,*p2=buf,duf[Len],*q1=duf;
il char gc(); il int rd(); il vd pc(char c); il vd rt(int x); il vd flush();
int q,l,r;
il int Get(int x){
	int ans=(x+1)/2;
	if(x&1) ans=-ans;
	return ans;
}
signed main(){
	q=rd();
	while(q--){
		l=rd(),r=rd(),rt(Get(r)-Get(l-1)),pc('\n');
	}
	return flush(),0;
}

il char gc(){return p1==p2&&(p2=(p1=buf)+fread(buf,1,Len,stdin),p1==p2)?-1:*p1++;}
il int rd(){char c;
	while(!isdigit(c=gc())&&c!='-');
	int f=c=='-'?c=gc(),1:0,x=c^48;
	while(isdigit(c=gc())) x=((x+(x<<2))<<1)+(c^48);
	return f?-x:x;
}
il vd pc(char c){q1==duf+Len&&fwrite(q1=duf,1,Len,stdout),*q1++=c;}
il vd rt(int x){x<0?pc('-'),x=-x:0,pc((x>=10?rt(x/10),x%10:x)+48);}
il vd flush(){fwrite(duf,1,q1-duf,stdout);}


#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<cstdlib>
using namespace std;
int q;
int main(){
	int l,r;
	scanf("%d",&q);
	for(int i=1;i<=q;++i){
		scanf("%d%d",&l,&r);
		if(l==r){
			if(l%2==1) printf("-%d\n",l);
			else printf("%d\n",l);
			continue;
		}
		if(l%2==0&&r%2==1) printf("-%d\n",(r-l+1)/2);
		if(l%2==1&&r%2==1) printf("%d\n",(r-l)/2-r);
		if(l%2==1&&r%2==0) printf("%d\n",(r-l+1)/2);
		if(l%2==0&&r%2==0) printf("%d\n",r-(r-l)/2);
	}
	return 0;
}


#include<algorithm>
#include<iostream>
#include<cstdlib>
#include<cstring>
#include<cctype>
#include<cstdio>
#include<vector>
#include<string>
#include<queue>
#include<stack>
#include<cmath>
#include<map>
#include<set>
using namespace std;
const int inf=0x7fffffff;
const double eps=1e-10;
const double pi=acos(-1.0);
//char buf[1<<15],*S=buf,*T=buf;
//char getch(){return S==T&&(T=(S=buf)+fread(buf,1,1<<15,stdin),S==T)?0:*S++;}
inline int read(){
	int x=0,f=1;char ch;ch=getchar();
	while(ch<'0'||ch>'9'){if(ch=='-') f=0;ch=getchar();}
	while(ch>='0'&&ch<='9'){x=(x<<1)+(x<<3)+(ch&15);ch=getchar();}
	if(f)return x;else return -x;
}
int n,l,r,size;
int main()
{
	n=read();
	while(n--){
		l=read();r=read();
		size=r-l+1;
		if((size&1)==0){
			if(l&1)printf("%d\n",size>>1);
			else printf("%d\n",-(size>>1));
		}
		else{
			size=r-l;
			if(r&1)r=-r;
			if(l&1)printf("%d\n",(size>>1)+r);
			else printf("%d\n",-(size>>1)+r);
		}
	}
	return 0;
}


#include<iostream>
using namespace std;
int main(){
	int n;
	cin>>n;
	while(n--){
		int l,r;
		cin>>l>>r;
		int ans=0;
		if((r-l)%2==0)ans=l+(r-l)/2;
		else ans=(r-l)/2+1;
		if(r%2)ans=-ans;
		cout<<ans<<endl;
	}
}


#include<stdio.h>
#include<cstring>
#include<algorithm>
#include<math.h>
#define re register int
#define fast static int
using namespace std;
typedef long long ll;
ll read()
{
	register ll x=0,f=1;
	char ch=getchar();
	while(ch<'0' || ch>'9')
	{
		if(ch=='-')	f=-1;
		ch=getchar();
	}
	while(ch>='0' && ch<='9')
	{
		x=10*x+ch-'0';
		ch=getchar();
	}
	return x*f;
}
const int Size=300005;
const int INF=0x3f3f3f3f;
int l,r;
void init()
{
	l=read();
	r=read();
}
int main()
{
	int q=read();
	while(q--)
	{
		init();
		ll L1=(l%2==0)?l:l+1,R1=(r%2==0)?r:r-1;
		ll L2=(l%2==1)?l:l+1,R2=(r%2==1)?r:r-1;
		ll ans1=(L1+R1)*((R1-L1)/2+1)/2;
		ll ans2=(L2+R2)*((R2-L2)/2+1)/2;
		printf("%I64d\n",ans1-ans2);
	}
	return 0;
}


#include <bits/stdc++.h>

/* run this program using the console pauser or add your own getch, system("pause") or input loop */
typedef long long ll;
using namespace std;
const int md = 1e9 + 7;
ll m,a[100001],b[100001];

int main() {
	int x,n,m;
	while(scanf("%d",&x)!=EOF)
	{
		for(int i=0;i<x;i++){
			ll sum = 0;
			int n,m;
			scanf("%d%d",&n,&m);
			for(;n<=m;n++){
				if(n%2)
					sum -= n;
				else
					sum += n;
			}
			cout<<sum<<endl;
		}
	}
	return 0;
}


#include <bits/stdc++.h>

/* run this program using the console pauser or add your own getch, system("pause") or input loop */
typedef long long ll;
using namespace std;
const int md = 1e9 + 7;
ll m,a[100001],b[100001];

int main() {
	int n,m;
	while(scanf("%d%d", &n, &m)!=EOF)
	{
		int sum = 0;
		for(;n<=m;n++){
			if(n%2)
				sum -= n;
			else
				sum += n;
		}
		cout<<sum<<endl;
	}
	return 0;
}


#include <bits/stdc++.h>

/* run this program using the console pauser or add your own getch, system("pause") or input loop */
typedef long long ll;
using namespace std;
const int md = 1e9 + 7;
ll m,a[100001],b[100001];

int main() {
	int x,n,m;
	while(scanf("%d",&x)!=EOF)
	{
		for(int i=0;i<x;i++){
			int sum = 0;
			int n,m;
			scanf("%d%d",&n,&m);
			for(;n<=m;n++){
				if(n%2)
					sum -= n;
				else
					sum += n;
			}
			cout<<sum<<endl;
		}
	}
	return 0;
}


#include <bits/stdc++.h>

/* run this program using the console pauser or add your own getch, system("pause") or input loop */
typedef long long ll;
using namespace std;
const int md = 1e9 + 7;
ll m,a[100001],b[100001];

int main() {
	int x,n,m;
	while(scanf("%d",&x)!=EOF)
	{
		for(int i=0;i<x;i++){
			scanf("%d%d",&n,&m);
			int ct = m - n + 1;
			int sum = 0;
			sum -= ct/2;
			if(n%2){
				sum = 0 - sum;
			}
			if(ct%2){
				if(m%2)
					sum -= m;
				else
					sum += m;
			}
			printf("%d\n",sum);
		}
	}
	return 0;
}


#include <bits/stdc++.h>

/* run this program using the console pauser or add your own getch, system("pause") or input loop */
typedef long long ll;
using namespace std;
const int md = 1e9 + 7;
ll m,a[100001],b[100001];

int main() {
	int x,n,m;
	while(scanf("%d",&x)!=EOF)
	{
		for(int i=0;i<x;i++){
			scanf("%d%d",&n,&m);
			int ct = m - n + 1;
			int sum = 0;
			sum += ct/2;
			if(n%2){
				sum = 0 - sum;
			}
			if(ct%2){
				sum += m;
			}
			printf("%d\n",sum);
		}
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
	long long l[1000],r[1000],q,temp=0,a[1000];
	do
	{
		cin >> q;
	}
	while(q<1||q>1000);
	for(int i=0;i<q;i++)
	{
		cin >> l[i];
		cin >> r[i];
	}
	for(int i=0;i<q;i++)
	{
		temp=0;
		for(int j=l[i];j<=r[i];j++)
		{
			if(j%2==0)
			temp+=j;
			else
			if(j%2!=0)
			temp+=-j;
		}
		cout << temp << endl;
	}
	return 0;
}


#include<iostream>
#include<cstring>
#include<cmath>
using namespace std;
int q;
int l,r;
int main()
{
	cin>>q;
	for(int i=1;i<=q;i++)
	{
		cin>>l>>r;
		int cnt=r-l+1;
		int ans=0;
		if(l%2==0)
		{
			ans+=-1*(cnt/2);
			if(cnt%2==1)
				ans+=r;
		}
		else
		{
			ans+=1*(cnt/2);
			if(cnt%2==1)
				ans+=(-1)*r;
		}
		cout<<ans<<endl;
	}
	return 0;
}


#include <cstdio>
#include <algorithm>
using namespace std;
int main(){
	long long q, i, j, l, r, t1, t2, ans;
	scanf("%lld", &q);
	for (i = 1; i <= q; i++){
		scanf("%lld%lld", &l, &r);
		if (l == r){
			if (l % 2 == 0) printf("%lld", l);
			else printf("%lld", -l);
		}else if (r - l == 1){
			if (l % 2 == 0) printf("-1");
			else printf("1");

		}else{
			ans = 0;
			if (r % 2 != 0){
				ans += (-r);
				r--;
			}
			if (l % 2 == 0){
				ans += l;
				l++;
			}
			ans += (r - l + 1) / 2;
			printf("%lld", ans);
		}
		printf("\n");
	}
	return 0;
}


#include<iostream>
using namespace std;
int main()
{
    int n;
    cin>>n;
    for(int l=1;l<=n;l++)
    {
        int a,b;
        cin>>a>>b;
        int m=0;

        if(b-a>50)
        {
            m=(b-a)/2;
        }
        else
        {
            for(int i=a;i<=b;i++)
            {
                if(i%2==1)
                {m=m-i;}
                else
                {m=m+i;}
            }
        }
        cout<<m<<endl;
    }
    return 0;
}


#include<iostream>
using namespace std;
int main()
{
    int n;
    cin>>n;
    for(int l=1;l<=n;l++)
    {
        int a,b;
        cin>>a>>b;
        int m=0;
        if(b-a>40)
        {
            if((b-a)%2==0)
            {
                m=(a-b)/2-1;
            }
            else
            {
                m=(b-a)/2+1;
            }
        }
        else
        {
            for(int i=a;i<=b;i++)
            {
                if(i%2==1)
                {m=m-i;}
                else
                {m=m+i;}
            }
        }
        cout<<m<<endl;
    }
    return 0;
}


#include<iostream>
using namespace std;
int main()
{
    int n;
    cin>>n;
    for(int l=1;l<=n;l++)
    {
        int a,b;
        cin>>a>>b;
        int m=0;
        for(int i=a;i<=b;i++)
        {
            if(i%2==1)
            {m=m-i;}
            else
            {m=m+i;}
        }
        /*
        if(l==n)
        {cout<<m;}
        else
        {cout<<m<<endl;}
        */
        cout<<m<<endl;
    }
    cin>>n;
    return 0;
}


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

typedef vector<int> vi;
typedef pair<int,int> pi;
typedef long long ll;
#define F first
#define S second
#define PB push_back
#define MP make_pair
#define REP(i,a,b) for (int i = a; i <= b; i++)
using namespace std;

int main(){
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	ll q;
	cin >> q;

	ll l, r;

	ll sum;

	while(q--){
		cin >> l >> r;

		if(l == r && l % 2 == 0){
			cout << l << "\n";
			continue;
		}
		else if(l == r && l % 2 == 1){
			cout << l * -1 << "\n";
			continue;
		}
		else{
			sum = 0;
			for(int i = l; i <= r; i++){
				if(i % 2 == 0){
					sum += i;
//					cout << sum << "\n";
				}
				else{
					sum = sum + i*(1*-1);
//					cout << sum << "\n";
				}
			}
		}
//		else if(l % 2 == 0){
//			for(int i = l; i <= r; i++){
//				sum += l*(pow(-1, l));
//			}
//		}
//		else if(l % 2 == 1){
//			for(int i = l; i <= r; i++){
//				sum += l*(pow(-1, l));
//			}
//		}

		cout << sum << endl;
	}

	return 0;
}


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

typedef vector<int> vi;
typedef pair<int,int> pi;
typedef long long ll;
#define F first
#define S second
#define PB push_back
#define MP make_pair
#define REP(i,a,b) for (int i = a; i <= b; i++)
using namespace std;

ll solve(ll num){

	if(num%2 == 0){
		num/=2;
		return num;
	}

	num = - 1 - num/2;
	return num;
}

int main(){
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	ll q;
	cin >> q;

	ll l, r;

	while(q--){

		cin >> l >> r;
		l--;
		l=solve(l);
		r=solve(r);
		cout << r - l << endl;

	}

	return 0;
}


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

typedef vector<int> vi;
typedef pair<int,int> pi;
typedef long long ll;
#define F first
#define S second
#define PB push_back
#define MP make_pair
#define REP(i,a,b) for (int i = a; i <= b; i++)
using namespace std;

ll solve(ll num){

	if(num%2 == 0){
		num/=2;
		return num;
	}

	num = - 1 - num/2;
	return num;
}

int main(){
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	ll q;
	cin >> q;

	ll l, r;

	while(q--){

		cin >> l >> r;
		l--;
		l=fun(l);
		r=fun(r);
		cout << r - l << endl;

	}

	return 0;
}


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

typedef vector<int> vi;
typedef pair<int,int> pi;
typedef long long ll;
#define F first
#define S second
#define PB push_back
#define MP make_pair
#define REP(i,a,b) for (int i = a; i <= b; i++)
using namespace std;

int main(){
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	ll q;
	cin >> q;

	ll l, r;

	ll sum;

	while(q--){
		cin >> l >> r;

		if(l == r && l % 2 == 0){
			cout << l << "\n";
			continue;
		}
		else if(l == r && l % 2 == 1){
			cout << l * -1 << "\n";
			continue;
		}
		else{
			if(l == 2 && r == 3) sum = -1;
			else if(l % 2 == 0 && r % 2 == 1){
				sum = (r - l - 1) * -1;
			}
			else if(l % 2 == 1 && r % 2 == 1){
				sum = (r - l) * -1;
			}
			else if(l % 2 == 0 && r % 2 == 0){
				sum = l + (l/2);
			}
			else if(l % 2 == 1 && r % 2 == 0){
				sum = r / l;
			}
		}
//		else if(l % 2 == 0){
//			for(int i = l; i <= r; i++){
//				sum += l*(pow(-1, l));
//			}
//		}
//		else if(l % 2 == 1){
//			for(int i = l; i <= r; i++){
//				sum += l*(pow(-1, l));
//			}
//		}

		cout << sum << endl;
	}

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int q;
int main() {
	cin>>q;
	for(int i=1; i<=q; i++) {
		int ans=0;
		int l,r;
		cin>>l>>r;
		l--;
		if(l%2==0) l/=2;
		else l=-(l+1)/2;
		if(r%2==0) r/=2;
		else r=-(r+1)/2;
		cout<<r-l<<endl;
	}
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        int l,r,ans=0;
        cin>>l>>r;
        int tt=(r-l+1)/2;

        if(l%2!=0)
            ans=tt;
        else ans=tt*(-1);

        if((r-l+1)%2!=0)
        {
            if(r%2==0)
                ans+=r;
            else ans-=r;
        }
        cout<<ans<<endl;
    }
    return 0;
}


#include<algorithm>
#include<iostream>
#include<cstdlib>
#include<cstring>
#include<cctype>
#include<cstdio>
#include<vector>
#include<string>
#include<queue>
#include<stack>
#include<cmath>
#include<map>
#include<set>
using namespace std;
const int inf=0x7fffffff;
const double eps=1e-10;
const double pi=acos(-1.0);
//char buf[1<<15],*S=buf,*T=buf;
//char getch(){return S==T&&(T=(S=buf)+fread(buf,1,1<<15,stdin),S==T)?0:*S++;}
inline int read(){
	int x=0,f=1;char ch;ch=getchar();
	while(ch<'0'||ch>'9'){if(ch=='-') f=0;ch=getchar();}
	while(ch>='0'&&ch<='9'){x=(x<<1)+(x<<3)+(ch&15);ch=getchar();}
	if(f)return x;else return -x;
}
int n,l,r,size;
int main()
{
	n=read();
	while(n--){
		l=read();r=read();
		size=r-l+1;
		if((size&1)==0){
			if(l&1)printf("%d\n",size>>1);
			else printf("%d\n",-(size>>1));
		}
		else{
			size=r-l;
			if(r&1)r=-r;
			if(l&1)printf("%d\n",(size>>1)+r);
			else printf("%d\n",-(size>>1)+r);
		}
	}
	return 0;
}


#include <stdio.h>
#include <iostream>
using namespace std;
int l,r,n,s;
int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	register int i;
	cin>>n;
	for(i=1;i<=n;i++)
	{
		s=0;
		cin>>l>>r;
		l-=1;
		if(l%2==0)
			l/=2;
		else
			l=-(l+1)/2;
		if(r%2==0)
			r/=2;
		else
			r=-(r+1)/2;
		cout<<r-l<<endl;
	}
	return 0;
}


#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
using namespace std;
int n,ans;
int l,r;
int main()
{
	scanf("%d",&n);
	for(int i=1;i<=n;i++){
		scanf("%d%d",&l,&r);
		if(l==r){
			if(l&1) printf("%d\n",-l);
			else printf("%d\n",l);
			continue;
		}
		if(l&1){
			if((r-l+1)&1) ans=(r-l+1)/2-r;
			else ans=(r-l+1)/2;
			printf("%d\n",ans);
		}
		else{
			if((r-l+1)&1) ans=-(r-l+1)/2+r;
			else ans=-(r-l+1)/2;
			printf("%d\n",ans);
		}
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main() {
	int n;
	scanf("%d",&n);
	while (n--) {
		int l,r;
		scanf("%d%d",&l,&r);
		if (l%2==0) {
			if (r%2==0)
				printf("%d\n",(r-l)/-2+l);
			else
				printf("%d\n",(l-r-1)/2);
		} else {
			if (r%2==0)
				printf("%d\n",(r-l+1)/2);
			else
				printf("%d\n",(l-r)/2-l);
		}
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int n;
int l,r;
long long ans;
int main()
{
	cin>>n;
	for(int i=1;i<=n;++i){
		scanf("%d%d",&l,&r);
		if((r-l+1)%2==0){
			if(l%2==1)cout<<(r-l+1)/2<<endl;
			else cout<<-(r-l+1)/2<<endl;
		}
		else{
			if(l%2==1){
				cout<<-(r+(((r-l+1)/2)*-1))<<endl;
			}
			else cout<<r+(-1*((r-l+1)/2))<<endl;
		}
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
long long sum;
int q,l,r;
long long work(int h)
{
	if(h==0) return 0;
	long long m=(long long)(1+h)*h/2;
	int d=h;
	if(d%2==0) d--;
	long long s=(1+d)/2;
	return m-2*s*s;
}
int main()
{
	cin>>q;
	while(q--)
	{
		scanf("%d %d",&l,&r);
		printf("%lld\n",work(r)-work(l-1));
	}
	return 0;
}


#include <cstdio>
#include <iostream>
#include <stack>
#include <utility>
#include <algorithm>
#include <ctime>
#include <set>
#include <cstring>
#include <string>
#include <vector>
#include <cmath>
#define rep(i,a,b) for(int i=(a);i<=(b);++i)
#define dec(i,a,b) for(int i=(a);i>=(b);--i)
#define gc() getchar()
#define endll putchar('\n')
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef long double ld;
inline ll read(){
    char ch=gc();
    ll x=0,f=1;
    while(ch<'0'||ch>'9'){
        if(ch=='-') f=-1;
        ch=gc();
    }
    while(ch>='0'&&ch<='9'){
        x=x*10+ch-'0';
        ch=gc();
    }
    return x*f;
}
inline void print(ll k){
    if(k<0) k=-k,putchar('-');
    if(k>9) print(k/10);
    putchar(k%10+48);
}
inline void println(ll k){
    print(k);
    endll;
}
inline void printsp(ll k){
    print(k);
    putchar(' ');
}
ll cal(ll l,ll r){
	return (l+r)*(((r-l)>>1)+1)>>1;
}
int main(){
	int q=read();
	rep(i,1,q){
		ll l=read(),r=read();
		ll tl=l,tr=r;
		if((tl&1)==0) ++tl;
		if((tr&1)==0) --tr;
		if(l&1)++l;
		if(r&1)--r;
		println(cal(l,r)-cal(tl,tr));
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
int q;
int main(){
	cin>>q;
	while(q--){
		int l,r;
		cin>>l>>r;
		long long ans=0;
		if(l&1){
			ans-=l;
			l++;
		}
		if(r%2==0){
			ans+=r;
			r--;
		}
		if(l<r){
			ans-=(r-l+1)/2;
		}
		cout<<ans<<endl;
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main() {
	int n;
	scanf("%d",&n);
	while (n--) {
		int l,r;
		scanf("%d%d",&l,&r);
		if (l%2==0) {
			if (r%2==0)
				printf("%d\n",(r-l)/2+l);
			else
				printf("%d\n",(l-r-1)/2);
		} else {
			if (r%2==0)
				printf("%d\n",(r-l+1)/2);
			else
				printf("%d\n",(l-r)/2-l);
		}
	}
	return 0;
}


#include<iostream>
#define int long long
using namespace std;
int q,l,r;
inline int f(int x){
	return x&1?x/2-x:x>>1;
}
signed main(){
	cin>>q;
	while(q--){
		cin>>l>>r;
		cout<<f(r)-f(l-1)<<endl;
	}
}


#include<bits/stdc++.h>
using namespace std;
const int SIZE=(1<<21)+1;
char ibuf[SIZE],*iS,*iT;
char gc()
{
    if(iS==iT) iT=(iS=ibuf)+fread(ibuf,1,SIZE,stdin);
    if(iS==iT) return EOF;
    return *iS++;
}
inline int _read()
{
    char c; int x=0;
    for(;c<'0'||c>'9';c=gc());
    for(;c>='0'&&c<='9';c=gc())x=(x<<1)+(x<<3)+c-'0';
    return x;
}
int main()
{
#ifndef ONLINE_JUDGE
	freopen("b.in","r",stdin);
	freopen("b.out","w",stdout);
#endif
	int q=_read();
	while(q--)
	{
		int l=_read(),r=_read();
		long long ans=0;
		long long tl=(l%2?l+1:l),tr=(r%2?r-1:r);
		if(tl<=tr) ans+=(tl+tr)*(tr-tl+2)/4ll;
		tl=(l%2?l:l+1),tr=(r%2?r:r-1);
		if(tl<=tr) ans-=(tl+tr)*(tr-tl+2)/4ll;
		printf("%I64d\n",ans);
	}

}


#include <cstdio>
using namespace std;
int n,l,r;
int main(){
	scanf("%d",&n);
	while(n--){
		scanf("%d %d",&l,&r);
		l--;
		int s1=(l%2)?(-l/2-1):l/2;
		int s2=(r%2)?(-r/2-1):r/2;
		printf("%d\n",s2-s1);
	}
	return 0;
}


#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <cmath>

using namespace std;

int main()
{
	int q;
	scanf("%d",&q);
	while(q --)
	{
		int l,r;
		scanf("%d%d",&l,&r);
		l --;
		if(l == 0)
		{
			r = ((r - 1) / 2 + 1) * (r % 2 ? -1 : 1);
			printf("%d\n",r);
		}
		else
		{
			r = ((r - 1) / 2 + 1) * (r % 2 ? -1 : 1);
			l = ((l - 1) / 2 + 1) * (l % 2 ? -1 : 1);
			printf("%d\n",r - l);
		}
	}
	return 0;
}


#include <bits/stdc++.h>

using namespace std ;

const int Q = 1e3 + 5 ;

int q , l , r ;

int ask( int x ) {
	if( x & 1 ) return x / 2 - x ;
	else return x / 2 ;
}

signed main() {
	cin >> q ;
	while( q -- ) {
		cin >> l >> r ;
		cout << ask( r ) - ask( l - 1 ) << endl ;
	}
	return 0 ;
}


#include<bits/stdc++.h>

using namespace std;
typedef long long INT;

INT calc(int n) {
	if(!n) return 0;
	int N=n>>1;
	INT n0=(INT)N*(1+N);

	N=n+1>>1;
	INT n1=(INT)N*N;
	return n0-n1;
}

void solve() {
	int l, r;
	scanf("%d %d", &l, &r);
	cout<<calc(r)-calc(l-1)<<endl;
}

int main() {
#ifndef ONLINE_JUDGE
	freopen("in.in", "r", stdin);
	freopen("out.out", "w", stdout);
#endif

	int q;
	scanf("%d", &q);
	while(q--) solve();
}


#include <bits/stdc++.h>

using namespace std;
#define NN 1010

int main() {
#ifndef ONLINE_JUDGE
	freopen("in.in", "r", stdin);
	freopen("out.out", "w", stdout);
#endif
	int q;
	scanf("%d",&q);
	while(q--){
		int x,y;
		scanf("%d%d",&x,&y);
		int len=y-x+1;
		if(len%2==0){
			if(x&1) printf("%d\n",len/2);
			else printf("%d\n",-len/2);
		}
		else{
			if(x&1) printf("%d\n",len/2-y);
			else printf("%d\n",y-len/2);
		}
	}

    return 0;
}


#include<bits/stdc++.h>

using namespace std;

typedef long long INT;

INT calc(int n) {
	if(n % 2 == 0) return n / 2;
	return n / 2 - n;
}

int main(){
#ifndef ONLINE_JUDGE
	freopen("in.in", "r", stdin);
	freopen("out.out", "w", stdout);
#endif
	int q;
	cin>>q;
	while(q--) {
		int l, r;
		scanf("%d%d", &l, &r);
		printf("%d\n", calc(r) - calc(l-1));
	}

}


#include <bits/stdc++.h>
#define x first
#define y second
#define pb push_back
#define sq(x) ((x)*(x))
using namespace std;
typedef double DO;
typedef long long INT;
typedef vector<int> VI;
typedef pair<int, int> pii;
typedef pair<pii, int> pi3;

const int inf=0x3f3f3f3f,mod=1000000007;
const INT INF=0x3f3f3f3f3f3f3f3fLL;
const DO pi=acosl(-1.),eps=1e-9;

inline int power(int a, int b, int m=mod, int ans=1) {
  for(; b; b>>=1, a=1LL*a*a%m) if (b&1) ans=1LL*ans*a%m;
  return ans;
}
INT a,b;
INT calc(INT a){
  if(a&1){
    return -a+((a-1)/2);
  }else{
    return (a/2);
  }
}
inline void solve(){
  scanf("%I64d %I64d",&a,&b);
  printf("%I64d\n",(calc(b)-calc(a-1)));
}

int main() {
#ifndef ONLINE_JUDGE
  freopen("in.in", "r", stdin);
  freopen("out.out", "w", stdout);
#endif
  int n;cin>>n;
  while(n--) solve();

  return 0;
}


#include <bits/stdc++.h>
using namespace std;
int main(){
	vector<int> v;
	int q,s=0;
	int r,l,m;
	scanf("%d",&q);
	m=q;
    while(m--){
    scanf("%d%d",&r,&l);
	if((l-r)%2!=0) s=(l-r+1)/2*(-1);
	else if(l==r) {
		if(l%2==0) s=l;
		else s=-l;
	}
	else {
		if(l%2==0) s=(l-r)/2*(1)+l;
		else s=(l-r)/2*(1)-l;;
	}
   printf("%d\n",s);
   s=0;
}
	return 0;
}


#include <iostream>
#include <list>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <algorithm>

using namespace std;
using ll = long long;

void dfs(int p, int v, const multimap<int, int>& Adj, vector<int>& S)
{
    S[v] = 1;
    auto iter = Adj.lower_bound(v);
    auto end = Adj.upper_bound(v);
    while (iter != end)
    {
        if (p != iter->second)
        {
            dfs(v, iter->second, Adj, S);
            S[v] += S[iter->second];
        }
        ++iter;
    }
}

int main()
{
    int n;
    cin >> n;
    multimap<int, int> Adj;
    for (int i = 0; i < n - 1; i++)
    {
        int u, v;
        cin >> u >> v;
        Adj.insert(make_pair(u, v));
        Adj.insert(make_pair(v, u));
    }
    if (n%2 != 0)
    {
        cout << -1 << '\n';
        return;
    }
    vector<int> S(n+1);
    dfs(0, 1, Adj, S);
    int Ans = -1;
    for (int i = 1; i <= n; i++)
        Ans += (S[i]%2 == 0 ? 1 : 0);
    cout << Ans << '\n';
    return 0;
}