#include <iostream>
using namespace std;
#define withRL
int main() {
string s;
getline(cin , s);
int i, j = 0;
bool ifspace = false;
for(i = 0; i < s.length(); i++){
if(s[i] == ' '){
#ifdef withRL
if(!ifspace){
#else
if(j && !ifspace){
#endif
ifspace = true;
s[j] = s[i];
j++;
}
}
else{
ifspace = false;
s[j] = s[i];
j++;
}
}
s.erase(j);
if(s.back() == ' ') s.pop_back();
cout << s << endl;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKI2RlZmluZSB3aXRoUkwKCmludCBtYWluKCkgewoJc3RyaW5nIHM7CglnZXRsaW5lKGNpbiAsIHMpOwoJaW50IGksIGogPSAwOwoJYm9vbCBpZnNwYWNlID0gZmFsc2U7Cglmb3IoaSA9IDA7IGkgPCBzLmxlbmd0aCgpOyBpKyspewoJCWlmKHNbaV0gPT0gJyAnKXsKCQkJI2lmZGVmIHdpdGhSTAoJCQlpZighaWZzcGFjZSl7CgkJCSNlbHNlCgkJCWlmKGogJiYgIWlmc3BhY2UpewoJCQkjZW5kaWYKCQkJCWlmc3BhY2UgPSB0cnVlOwoJCQkJc1tqXSA9IHNbaV07CgkJCQlqKys7CgkJCX0KCQl9CgkJZWxzZXsKCQkJaWZzcGFjZSA9IGZhbHNlOwoJCQlzW2pdID0gc1tpXTsKCQkJaisrOwoJCX0KCX0KCXMuZXJhc2Uoaik7CglpZihzLmJhY2soKSA9PSAnICcpIHMucG9wX2JhY2soKTsKCWNvdXQgPDwgcyA8PCBlbmRsOwp9
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEdhZ2FyaW4gYmVjYW1lICAgIGFuIGludGVybmF0aW9uYWwgY2VsZWJyaXR5LCBhbmQgd2FzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF3YXJkZWQgbWFueSBtZWRhbHMgYW5kIHRpdGxlcywgaW5jbHVkaW5nIEhlcm8gb2YgdGhlIFNvdmlldCBVbmlvbi4gICAgICAg
Gagarin became an international celebrity, and was awarded many medals and titles, including Hero of the Soviet Union.