#include <iostream>
#include <cstring>
using namespace std;
const short SIZE = 257;
int main(){
int j = 0;
char * str1 = new char[SIZE];
char * str2 = new char[SIZE];
cin.getline(str1, SIZE);
int space = 0;
for (int i = 0; i < strlen(str1); i++) {
if (str1[i] == ' '){
while (!space){
str2[j] = ' ';
j++;
space = 1;
}
}
else {
str2[j] = str1[i];
j++;
space = 0;
}
}
str2[j] = 0;
printf("%s", str2);
return 0;
}
ICAgICAgICAjaW5jbHVkZSA8aW9zdHJlYW0+CiAgICAgICAgI2luY2x1ZGUgPGNzdHJpbmc+CiAgICAgCiAgICAgICAgdXNpbmcgbmFtZXNwYWNlIHN0ZDsKICAgICAKICAgICAgICBjb25zdCBzaG9ydCBTSVpFID0gMjU3OyAgICAgCiAgICAgICAgaW50IG1haW4oKXsKICAgICAgICAJaW50IGogPSAwOwogICAgICAgICAgICBjaGFyICogc3RyMSA9IG5ldyBjaGFyW1NJWkVdOwogICAgICAgICAgICBjaGFyICogc3RyMiA9IG5ldyBjaGFyW1NJWkVdOwogICAgICAgICAgICBjaW4uZ2V0bGluZShzdHIxLCBTSVpFKTsKICAgICAgICAgICAgaW50IHNwYWNlID0gMDsKICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBzdHJsZW4oc3RyMSk7IGkrKykgewogICAgICAgICAgICAJaWYgKHN0cjFbaV0gPT0gJyAnKXsKICAgICAgICAgICAgCQl3aGlsZSAoIXNwYWNlKXsKICAgICAgICAgICAgCQkJc3RyMltqXSA9ICcgJzsKICAgICAgICAgICAgCQkgICAgaisrOwogICAgICAgICAgICAJCSAgICBzcGFjZSA9IDE7CiAgICAgICAgICAgIAkJfQogICAgICAgICAgICAJfQogICAgICAgICAgICAJZWxzZSB7CiAgICAgICAgICAgIAkJc3RyMltqXSA9IHN0cjFbaV07CiAgICAgICAgICAgIAkJaisrOwogICAgICAgICAgICAJCXNwYWNlID0gMDsKICAgICAgICAgICAgCX0KICAgICAgICAJfQogICAgICAgIAlzdHIyW2pdID0gMDsKICAgICAgICAgICAgcHJpbnRmKCIlcyIsIHN0cjIpOwogICAgICAgICAgICByZXR1cm4gMDsKICAgICAgICB9