#include<bits/stdc++.h>
using namespace std;
int main(){
string a,s="",d="";
int f=1;
cin>>a;
for(int i=0;i<a.size();i++){
if(a[i]!=',') s+=a[i];
else{
if(s.size()>12 || s.size()<6){continue;}
else{
for(int j=0;j<s.size();j++){
if((s[j]>='0' && s[j]<='9')||(s[j]>='a' && s[j]<='z')||(s[j]>='A' && s[j]<='Z')||s[j]=='!' || s[j]=='@'||s[j]=='#' || s[j]=='$'){}
else{f=0;break;}
}
if(f==0){
d+=s;
d+="\n";
}
s="";
f=1;
}
}
}
cout<<d;
return 0;
}