#include<bits/stdc++.h>
using namespace std;
int main()
{
string s,temp;
getline(cin,s);
int i=0,j=0;
while(i<=s.size())
{
if(s[i]!=' ')
{
temp.push_back(s[i]);
}
else
{
if(s[i-1]!=' ')
temp.push_back(' ');
}
i++;
}
cout<<temp<<endl;
return 0;
}