#include <bits/stdc++.h>
using namespace std;
char ans[100001];
int main()
{
string str;
cin >> str;
bool flag = true;
int lon = 0;
str += ',';
for (int i = 0; i < str.length(); ++i)
{
if (str[i] == ',')
{
if (flag == true)
{
if (lon >= 6 && lon <= 12)
{
for (int j = 0; j < lon; ++j)
{
cout << ans[j];
}
cout << endl;
}
}else
{
flag = true;
}
lon = 0;
}else
{
int f = 0;
ans[lon++] = str[i];
if (str[i] >= '0' && str[i] <= '9')
++f;
if (str[i] >= 'a' && str[i] <= 'z')
++f;
if (str[i] >= 'A' && str[i] <= 'Z')
++f;
if (str[i] == '!')
++f;
if (str[i] == '@')
++f;
if (str[i] == '#')
++f;
if (str[i] == '$')
++f;
if (f == 0)
{
flag = false;
}
}
}
return 0;
}