#include <iostream>
#include <string>
using namespace std;

int main(int argc, const char * argv[]) {
    // insert code here...

    string separator{" \t\r\n,.!?;:"};
    string line; 
    string word;
    while(getline (cin, line)){  // read line by line 
    	size_t e,s=0;
    	do {
            s = line.find_first_not_of(separator,s);
            if (s==string::npos) 
                break;
    		e=line.find_first_of(separator, s); 
    		string word(line.substr(s,e-s)); 
		    cout<<word<<endl;
		    s=e+1;
    	} while (e!=string::npos);
    }

    return 0;
}
