#include <iostream>
using namespace std;
int main() {
string str;
getline(cin, str);
string res;
for (int i = 0; str[i]; i++) {
if (str[i] != ' ') res = res + str[i];
else if (str[i] == ' ' && res[res.size()-1] != ' ') res = res + str[i];
}
cout << res << endl;
return 0;
}