#include <bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    cin>>n;
    int a=0,b=0,c=0,d=0;
    while(n--)
    {
        string s;
        string p="AC",q="WA",r="TLE",s="TLE";
        cin>>s;
        if(s.compare(p)==0)
          a++;
        else if(s.compare(s)==0)
          b++;
        else if(s.compare(r)==0)
          c++;
        else
          d++;
    }
    cout<<p<<" x "<<a<<"\n";
    cout<<q<<" x "<<b<<"\n";
    cout<<r<<" x "<<c<<"\n";
    cout<<s<<" c "<<d<<"\n";  

}