#include<bits/stdc++.h>
#include<string>
using namespace std;
int main(){
int low=0,up=0,num=0,chr=0,nub=0,z=0;
string s;string a;
getline(cin,s);
for(int i=0;i<s.length();i++){
if(s[i]==','){
if(nub==0 and (z>=6 and z<=12) and low+up+num>=2 and chr==1){
cout<<a<<endl;
}
a="";
low=0,up=0,num=0,chr=0,nub=0,z=0;
}else{
if(s[i]>='a' and s[i]<='z') low=1;
else if(s[i]>='A' and s[i]<='Z') up=1;
else if(isdigit(s[i])) num=1;
else if(s[i]=='!' or s[i]=='#' or s[i]=='$' or s[i]=='@') chr=1;
else nub=1;
z++;
string tmp=" ";
tmp[0]=s[i];
a.append(tmp);
}
}
if(z>0){
if(nub==0 and (z>=6 and z<=12) and low+up+num>=2 and chr==1){
cout<<a<<endl;
}
}
}