#include<stdio.h>
#include<string>
#include<set>
#include<iostream>
using namespace std;
const int MAXN=110;
set<string> ans[MAXN];
bool isValid(char c){
if((c>='a'&&c<='z')||(c>='A'&&c<='Z')){
return true;
}
return false;
}
//小写转成大写;
void change(string& str){
for(int i=0;i<str.length();i++){
if(str[i]>='A'&&str[i]<='Z'){
str[i]+=32;
}
}
}
//用非有效字符分割
void split(string str,set<string>& ans){
int first=0,last=0;
string temp;
while(last<str.length()){
if(isValid(str[last])){
temp+=str[last];
last++;
}else{
if(temp.length()>=3){
temp=temp.substr(0,10);//长度超过10的截断
ans.insert(temp);
}
last++;
first=last;
temp.clear();
}
}
if(temp.length()>=3){
temp=temp.substr(0,10);
ans.insert(temp);//分割的最后一段
}
}
int n;
int main(){
scanf("%d%*c",&n);
for(int i=1;i<=n;i++){