        #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;
        }