#include <algorithm> #include <vector> #include <iterator> #include <string> #include <iostream> using namespace std; int main() { string strWord; vector<string> word; cin>>strWord; cout<<strWord; string::iterator start=strWord.begin(); while(start!=strWord.end()) { string::iterator comma=find(start,strWord.end(),','); if (comma==strWord.end()) { word.push_back(start); break; } word.push_back(string(start,comma)); start=comma; start++; } for (vector<string>::iterator iter=word.begin();iter!=word.end();++iter) { cout<<*iter<<endl; } return 0; }