#include <cstdlib>
#include <iostream>
#include <vector>
#include <cstring>

using namespace std;

int main()
{
	vector<string> v;
	string sm;
	while( getline(cin, sm) )
	{
		v.push_back(sm);
	}
	int p[v.size()]; 									

	int max=0;		 									
	for( int i=0 ; i<(int)v.size() ; i++ )
	{
		p[i]=0;
		string s;
		for( int j=0 ; j<(int)v[i].length() ; j++ ) 	
		{
			if( v[i][j] != ' ' )
			{
				s+= v[i][j];
			}
			else if( v[i][j+1] != ' ' )
			{
				s+=' ';
				p[i]++;
			}
		}
		if( s[0] == ' ' ) 								
		{
			s.erase(0, 1);
			p[i]--;
		}
		if( s[s.length()-1] == ' ' ) 				
		{
			if( strchr( ",.!-?:\"\'", s[s.length()-2] )!=NULL ) s.erase(s.length()-1, 1); 
			p[i]--;
		}

		v[i] = s; 										

		if( max < (int)v[i].length() )					
		{
			max = (int)v[i].length();  				
		}
	}
	for( int i=0 ; i<(int)v.size() ; i++ ) 				
	{
		int k = (int)v[i].length();  					
		for( int j=0 ; j<(int)v[i].length() ; j++ )		
		{
			if( v[i][j] == ' ' && j+1!=(int)v[i].length() ) 
			{
				v[i].insert(j, (max-k)/p[i], ' ');      
				j+=(max-k)/p[i];						
			}
		}
		v[i].insert(0, (max-k)%p[i], ' ');    			
	}
	
	for( int i=0 ; i<(int)v.size() ; i++ )				
	{
		cout << v[i] << endl;
	}
}