#include<bits/stdc++.h>
using namespace std;
bool checkc(char c){
if(c>='a' and c<='z') return true;
if(c>='A' and c<='Z') return true;
if(c>='0' and c<='9') return true;
if(c=='!' or c=='@' or c=='#' or c=='$') return true;
}
bool checks(string s){
int l=s.length();
if(l<6 or l>12) return false;
for(int i=0;i<l;i++) if(checkc(s[i])==false) return false;
return true;
}
int main(){
string lin="";bool p=true;char c;
while(cin>>c){
if(c==','){
if(checks(lin)==true) cout<<lin<<endl;
lin="";
continue;
}
else lin+=c;
}
return 0;
}