#include <iostream>
#include <algorithm>
using namespace std;
 
bool BothAreSpaces(char lhs, char rhs) { return (lhs == rhs) && (lhs == ' '); }

int main() {
	string str;

	getline(cin, str);

	str.erase(unique(str.begin(), str.end(), BothAreSpaces), str.end());
        
	cout << str;
 
	return 0;
}