//zadanie: połowa
#include<bits/stdc++.h>
using namespace std;
int licz(string &napis, char litera)
{
int cnt = 0;
for(auto znak: napis) cnt += znak == litera;
return cnt;
}
int main(){
int t;
cin>>t;
string napis, pom;
cin.ignore();//usuwamy enter z bufora, aby działała funkcja getline
while(t--)
{
getline(cin, pom);
napis+=pom;
}
for(char lit = 'a'; lit <= 'z'; lit++)
{
int policz = licz(napis, lit);
if(policz > 0)
cout<<lit<<' '<<policz<<endl;
}
for(char lit = 'A'; lit <= 'Z'; lit++)
{
int policz = licz(napis, lit);
if(policz > 0)
cout<<lit<<' '<<policz<<endl;
}
return 0;
}
Ly96YWRhbmllOiBwb8WCb3dhCiNpbmNsdWRlPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgppbnQgbGljeihzdHJpbmcgJm5hcGlzLCBjaGFyIGxpdGVyYSkKewoJaW50IGNudCA9IDA7Cglmb3IoYXV0byB6bmFrOiBuYXBpcykgY250ICs9IHpuYWsgPT0gbGl0ZXJhOwoJcmV0dXJuIGNudDsKfQoKaW50IG1haW4oKXsKCWludCB0OwoJY2luPj50OwoJc3RyaW5nIG5hcGlzLCBwb207CgljaW4uaWdub3JlKCk7Ly91c3V3YW15IGVudGVyIHogYnVmb3JhLCBhYnkgZHppYcWCYcWCYSBmdW5rY2phIGdldGxpbmUKCXdoaWxlKHQtLSkKCXsKCQlnZXRsaW5lKGNpbiwgcG9tKTsKCQluYXBpcys9cG9tOwoJCQoJfQoJZm9yKGNoYXIgbGl0ID0gJ2EnOyBsaXQgPD0gJ3onOyBsaXQrKykKCXsKCQlpbnQgcG9saWN6ID0gbGljeihuYXBpcywgbGl0KTsKCQlpZihwb2xpY3ogPiAwKQoJCQljb3V0PDxsaXQ8PCcgJzw8cG9saWN6PDxlbmRsOwoJfQoJZm9yKGNoYXIgbGl0ID0gJ0EnOyBsaXQgPD0gJ1onOyBsaXQrKykKCXsKCQlpbnQgcG9saWN6ID0gbGljeihuYXBpcywgbGl0KTsKCQlpZihwb2xpY3ogPiAwKQoJCQljb3V0PDxsaXQ8PCcgJzw8cG9saWN6PDxlbmRsOwoJfQoJcmV0dXJuIDA7Cn0g