#include <iostream>
#include <map>
#include <string>
#define ll long long

using namespace std;

int main()
{
int n;
string s;
map<string,int>mp;
map<string,int> :: iterator i;

cin>>n;
mp[AC]=0;
mp[WA]=0;
mp[TLE]=0;
mp[RE]=0;

while (n--)
{
cin>>s;
mp[s]++;
}

for(auto i:mp)
{
cout<<i.first<<" x "<<i.second;
if(i<n-1)
cout<<"\n";
}

return 0;
}