//*******************************************************************
//* ???????????   										*
//* ?????????????????								*
//*??? ???													*
//*???2010?12?8?												*
//*******************************************************************
int main()
{
	char str[100];
	cin.getline(str, 100);                           //???????????
	char * p = str;                                  //?????????????????????
	int i, j;
	int count = 0;                                   //??count??????????
	for (i = 0; *(p + i) != '\0'; i ++)              //??????
	{
		
		if(*(p+i) == ' ')                  
			count ++;                               //?????????????
		if (count == 1 && *(p+i) != ' ')            //?????????????????0
		 count = 0;
		if( count >= 2 && *(str+i) != ' ')           //?????????
		{
			for (j = i - count + 1; *(p+j) != '\0'; j ++)//???????
			 *(p+j) = *(p+j + count - 1);
			i -= count;
			count = 0;                       //????????0
		}
		
	}
	       //????
	cout << str;
	cout << endl;
	return 0;
}
