#include <string>
#include <sstream>
char str[1009];
int main() {
string line;
//string流方式
while(getline(cin, line)) {
stringstream ss(line);
for(string str; ss>>str; cout<<str<<endl);
}
//scanf方式
while(~scanf("%s", str+1)) {
cout<<str+1<<endl;
}
while(scanf("%s", str) != EOF) {
cout<<str+1<<endl;
}
}