#include <iostream>
using namespace std;
string str[20];
int main()
{
int stri=0;
int strlen = 0;
int kind = 0;
int skind = 0;
char c;
while (true)
{
cin.get(c);
if (c == 10) {
break;
}else if (c != ',') {
if ((c >= '0' and c <= '9') or (c >= 'A' and c <= 'Z')
or (c >='a' and c<='z')
or (c=='!') or (c=='@') or (c=='#') or (c=='$')){
if((c >= '0' and c <= '9') or (c >= 'A' and c <= 'Z') or (c >='a' and c<='z'))
kind++;
else skind++;
strlen++;
str[stri]+=c;
}
else {
bool isEnd = false;
do {
cin.get(c);
if (c == 10) {
isEnd = true;
break;
}
} while (c!=',');
if (isEnd)
return 0;
}
}else {
if ((strlen >= 6 and strlen <= 12) and (kind >= 2 and skind >=1)) {
cout << str[stri] << endl;
}
strlen = 0;
kind = 0;
skind = 0;
stri++;
}
}
}