#include <iostream>
#include <cstring>
using namespace std;
const int N = 500;
char ans[N];
int main(void)
{
string str;
getline(cin, str);
int cnt = 0;
for (int i = 0; i < str.size(); i++) {
if (str[i] != ' ') {
ans[cnt++] = str[i];
} else {
while (str[i] == ' ') i++;
ans[cnt++] = ' ';
i--;
}
}
cout << ans << endl;
return 0;
}