#include<bits/stdc++.h>
using namespace std;
map<string, int> topics;
int Max = 0;
string Insert_map(string str)
{
for(int i = 0; i < str.size(); i++)
{
if(str[i] >= 'A' && str[i] <= 'Z')
{
str[i] += 32;
continue;
}
else if((str[i] >= '0' && str[i] <= '9') || str[i] >= 'a' && str[i] <= 'z')
continue;
else
str[i] = ' ';
}
for(int i = 0; i < str.size(); i++)
{
if(str[i] == ' ')
{
if(i == 0 || i == str.size() - 1)
{
str.erase(i, 1);
i--;
}
else if(i != str.size() - 1)
if(str[i + 1] == ' ')
{
str.erase(i, 1);
i--;
}
}
}
return str;
}
void process_str(string In_str)
{
string str;
map<string, int> map1;
int flag = 0, pos_s = 0, pos_e = 0;
int N = In_str.length();
for(int i = 0; i < N ; i++)
{
if(In_str[i] == '#' && flag == 0)
{
pos_s = i;
flag = 1;
continue;
}
if(In_str[i] == '#' && flag == 1)
{
flag = 0;
if (pos_e == pos_s + 1)
continue;
pos_e = i;
str.assign(In_str.begin() + pos_s + 1, In_str.begin() + pos_e);
string str2;
str2 = Insert_map(str);
if(str2 == " " || str2 == "")
continue;
if(map1.count(str2) == 0)
map1.insert(make_pair(str2, 1));
}
}
map<string, int>::iterator iter;
for(iter = map1.begin(); iter != map1.end(); iter++)
{
if(iter->first == " ")
continue;
if(topics.count(iter->first) != 0)
topics[iter->first] += 1;
else
topics.insert(make_pair(iter->first, 1));
if(topics[iter->first] > Max)
Max = topics[iter->first];
}
}
int main()
{
string In_str, str;
int N;
scanf("%d", &N);
getchar();
for(int i =0; i < N; i++)
{
getline(cin, In_str);
process_str(In_str);
}
map<string, int>::iterator iter;
int flag = 0;
int n = 0;
for(iter = topics.begin(); iter != topics.end(); iter++)
{
if(iter->second == Max)
{
if(flag != 0)
{
if(In_str > iter->first)
In_str = iter->first;
}
else
In_str = iter->first;
flag++;
n++;
}
}
if(In_str[0] >= 'a' && In_str[0] <= 'z')
In_str[0] = In_str[0] - 32;
cout << In_str << endl;
cout << Max << endl;
if(n != 1)
cout << "And " << n - 1 << " more ...";
}