#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
void funk(string text) {
string delims(" .,:;-()");
string* words = new string[1000];
int i = 0;
string::size_type begin = 0;
while (begin < text.size())
{
begin = text.find_first_not_of(delims, begin);
string::size_type end = text.find_first_of(delims, begin);
if (end == string::npos)
end = text.size();
words[i++] = text.substr(begin, end - begin);
begin = end;
}
string* tmp = new string[1000];
sort(words, words + i);
for (int j = 0; j < i; ++j)
cout << words[j] << "\n";
}
int main() {
string text;
getline(cin, text);
funk(text);
return 0;
}