#include<bits/stdc++.h>
using namespace std;
int main(){
string test;
cin >> test;
test += ',';
int n = test.length();
int last = 0;
for (int i = 0;i < n;i++){
string one;
if (test[i] == ','){
one = test.substr(last,i-last);
last = i+1;int none = one.length();
if (none < 6 || none > 12){
continue;
}
int tw = 0;
for (int j = 0;j < none;j++){
if ((one[j] == '!' || one[j] == '$') || (one[j] == '#' || one[j] == '@')) tw += 114514;
else if(('a' <= one[j] && one[j] <= 'z') || ('A' <= one[j] && one[j] <= 'Z')) tw += 114514;
else if('0' <= one[j] && one[j] <= '9') tw += 114514;
}
if (tw == 114514 * none) cout << one <<endl;
}
}
return 0;
}