#include <iostream>
#include <string>
using namespace std;
int main(){
string s;
getline(cin, s);
for (int i = 0; i < s.length(); i++)
if (s[i] == ' ' && s[i + 1] == ' ') {s.erase(i, 1); i = (i - 1);}
cout << s << endl;
return 0;
}
ICAgICAgICAjaW5jbHVkZSA8aW9zdHJlYW0+CiAgICAgICAgI2luY2x1ZGUgPHN0cmluZz4KICAgICAKICAgICAgICB1c2luZyBuYW1lc3BhY2Ugc3RkOwogICAgIAogICAgICAgIGludCBtYWluKCl7CiAgICAgICAgICAgIHN0cmluZyBzOwogICAgICAgICAgICBnZXRsaW5lKGNpbiwgcyk7CiAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgcy5sZW5ndGgoKTsgaSsrKQogICAgICAgICAgICAgICAgaWYgKHNbaV0gPT0gJyAnICYmIHNbaSArIDFdID09ICcgJykge3MuZXJhc2UoaSwgMSk7IGkgPSAoaSAtIDEpO30KICAgICAgICAgICAgY291dCA8PCBzIDw8IGVuZGw7CiAgICAgICAgICAgIHJldHVybiAwOwogICAgICAgIH0=